In [1]:
import pandas as pd
import numpy as np
import math
In [2]:
s_nan = pd.Series([None, np.nan, math.nan, pd.np.nan])
print(s_nan)
In [3]:
print(s_nan[0])
print(type(s_nan[0]))
In [4]:
print(s_nan.isnull())
In [5]:
s_nan_int = pd.Series([None, pd.np.nan, 0, 1])
print(s_nan_int)
In [6]:
print(s_nan_int.isnull())
In [7]:
s_nan_str = pd.Series([None, pd.np.nan, 'NaN', 'nan'])
print(s_nan_str)
In [8]:
print(s_nan_str[0])
print(type(s_nan_str[0]))
In [9]:
print(s_nan_str.isnull())
In [10]:
s_nan_str_replace = s_nan_str.replace({'NaN': pd.np.nan, 'nan': pd.np.nan})
print(s_nan_str_replace)
In [11]:
print(s_nan_str_replace.isnull())