how to check if nan is in dataset in pandas code example
Example 1: dataframe find nan rows
df[df.isnull().any(axis=1)]
Example 2: check if a value is nan pandas
import numpy as np
import pandas as pd
val = np.nan
print(pd.isnull(val))
# True
df[df.isnull().any(axis=1)]
import numpy as np
import pandas as pd
val = np.nan
print(pd.isnull(val))
# True