I have pandas dataframe that I want to execute on it query function with isnull() or not isnull() condition like that:
In [67]: df_data = pd.DataFrame({\'a\':[1,
Use .:
.
a = df_data.query('a.isnull()') print (a) a 2 NaN b = df_data.query('a.notnull()') print (b) a 0 1.0 1 20.0 3 40.0 4 50.0
You can use also logic NaN != NaN:
NaN != NaN
a = df_data.query('a != a') print (a) a 2 NaN b = df_data.query('a == a') print (b) a 0 1.0 1 20.0 3 40.0 4 50.0