Reputation: 1672
I am trying to find the values with condition based on column values having values 'Y' or 'N' which is working fine and i am also checking other columns having date values in which isnull()
or isna()
not working , I have also tried with isnull().any() or isna().any() or empty
they are not working
I am getting the error
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
this is my dataframe
this is my code
filteringst=st.loc[(st['Passout'] =='Y') and (st['Passout Date'].isna().any())]
I have also tried like this
filteringst=st.loc[(st['Passout'] =='Y') and (st['Passout Date'].isnull().any())]
or
filteringst=st.loc[(st['Passout'] =='Y') and (st['Passout Date'].isnull())]
But getting the same error
Upvotes: 0
Views: 1685
Reputation: 862791
Use &
for bitwise AND
:
filteringst=st.loc[(st['Passout'] =='Y') & (st['Passout Date'].isnull())]
Upvotes: 2