find where df series is null and print 1

find where df series is null and print

df1 = df[df.isna().any(axis=1)]

Here is what the above code is Doing:
1. df.isna() returns a dataframe of booleans, where True indicates a missing value.
2. df.isna().any(axis=1) returns a series of booleans, where True indicates a row with a missing value.
3. df[df.isna().any(axis=1)] returns a dataframe of rows with missing values.

Similar Posts