I would like to find where None is found in the dataframe.
pd.DataFrame([None,np.nan]).isnull()
OUT:
0
0 True
1 True
isnull() finds both numpy Nan and None values.
I only want the None values and not numpy Nan. Is there an easier way to do that without looping through the dataframe?
Edit:
After reading the comments, I realized that in my dataframe in my work also include strings, so the None were not coerced to numpy Nan. So the answer given by Pisdom works.
Best Answer
If you want to get True/False for each line, you can use the following code. Here is an example as a result for the following DataFrame:
How to check
None
Available:
.isnull()
Available:
.apply
==
oris
None
Available:
.values
==
None
Unavailable:
is
or==
Unavailable:
.values
is
None
How to check
np.nan
Available:
.isnull()
Available:
np.isnan
Unavailable:
is
or==
np.nan