Python Forum
Variable being erased inside of if statement
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable being erased inside of if statement
#5
What do you mean by "disappeared"? What evidence do you have to come to your conclusion?

This is confusing.
Quote:if (not filter_a_dataframe.empty)
to
if (filter_a_dataframe.empty)
the variable doesn't get erased. Any ideas why this is happening? Also, I can provide the specific code if that helps. I was just trying to simplify it for easy reading.
When you remove the "not", the program flow changes. Statements that didn't run before now run. Is your proof that my_variable "disappeared" that nothing was printed? Maybe nothing was printed because filter_a_dataframe.empty is truthful.
Reply


Messages In This Thread
RE: Variable being erased inside of if statement - by deanhystad - Jun-09-2024, 10:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Variable definitions inside loop / could be better? gugarciap 2 602 Jan-09-2024, 11:11 PM
Last Post: deanhystad
  How to create a variable only for use inside the scope of a while loop? Radical 10 2,481 Nov-07-2023, 09:49 AM
Last Post: buran
  Cursor Variable inside Another Cursor . CX_ORacle paulo79 1 1,651 Apr-09-2022, 10:24 AM
Last Post: ibreeden
  An IF statement with a List variable dedesssse 3 8,991 Jul-08-2021, 05:58 PM
Last Post: perfringo
  define a variable using an if statement Margaridalopes 2 2,299 Oct-24-2020, 05:47 PM
Last Post: jefsummers
  Correct syntax for a variable inside a quotes: MP4Box command JonnyDriller 2 2,906 Feb-02-2020, 01:22 AM
Last Post: JonnyDriller
  How to store the value from variable into list & run a statement then put in variable searching1 1 2,574 May-29-2019, 06:36 AM
Last Post: heiner55
  Get variable from class inside another class hcne 3 2,973 Mar-30-2019, 03:02 PM
Last Post: ichabod801
  SELECT statement query question using a variable DT2000 2 3,176 Feb-23-2019, 07:35 AM
Last Post: DT2000
  Invalid syntax in two variable if statement? 00712411 1 2,377 Oct-10-2018, 12:36 AM
Last Post: stullis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020