find row with nan pandas code example
Example 1: dataframe find nan rows
df[df.isnull().any(axis=1)]
Example 2: select rows with nan pandas
df[df['Col2'].isnull()]
Example 3: count rows with nan pandas
np.count_nonzero(df.isnull().values)
np.count_nonzero(df.isnull()) # also works
Example 4: pandas if nan, then the row above
df.fillna(method='ffill')