find which rows have nan pandas code example
Example 1: dataframe find nan rows
df[df.isnull().any(axis=1)]
Example 2: to detect if a data frame has nan values
df.isnull().sum().sum()
5
Example 3: select rows with nan pandas
df[df['Col2'].isnull()]
Example 4: find nan values in a column pandas
df.isnull().sum().sum()