Hi,
I have a dataframe for which I want to create a filter.
I know you can do it via Boolean indexing, but now I found as well the pd.query method.
DF :
Thanks!
I have a dataframe for which I want to create a filter.
I know you can do it via Boolean indexing, but now I found as well the pd.query method.
DF :
col1 col2 0 Jan 3 1 Feb 4 2 Mar 5
df.query('col1 == "Feb"')would normally work, but I wonder how you can filter on 2 columns as
df.query('col1 == "Feb" and col2 == "Mar"')doesnt seem to work.
Thanks!