In [1]:
import pandas as pd
import numpy as np
In [2]:
df = pd.DataFrame([1, 2, 3, 4, 5, None], columns=['foo'])
In [3]:
df
Out[3]:
foo
0 1.0
1 2.0
2 3.0
3 4.0
4 5.0
5 NaN
In [4]:
a = 5
df['foo'] == a
Out[4]:
0    False
1    False
2    False
3    False
4     True
5    False
Name: foo, dtype: bool
In [5]:
a = np.nan
df['foo'] == a
Out[5]:
0    False
1    False
2    False
3    False
4    False
5    False
Name: foo, dtype: bool
In [6]:
a = None
df['foo'] == a
Out[6]:
0    False
1    False
2    False
3    False
4    False
5    False
Name: foo, dtype: bool