Data preparation
df=pd.DataFrame(np.random.randn(5,5)) df.columns=list('ABCDE') df.iloc[1,1]=np.nan
Extract Null values in column B use isnull ()
df[df['B'].isnull()]
Extract non-Null values in column B Negate extraction with isnull () Extract with (~)
df[~(df['B'].isnull())]
Recommended Posts