Assume I have the following table: Original dataframe
I add a column called "status" which is the pairs (gender, senior_management), which is basically the pairs: [ (Female, True), (Male, True), (Male, False), ...] and so on. suppose I am looking for certain conditions, so I defined the list:
conditions = [(Female, True), (Male, False)]
my goal is now to use query to make a new data frame that has only values that have condition. I currently have (note that MyDataframe is the old one and I'm trying to save it as a new one while keeping the old one):
NewDataFrame = MyDataFrame.query('status in @conditions')
NewDataframe.head()
this only results in the column names of the data frame: Flawed_result What is happening here? and how do I fix it?