pandas how nan rows code example
Example 1: count rows with nan pandas
np.count_nonzero(df.isnull().values)
np.count_nonzero(df.isnull()) # also works
Example 2: pandas if nan, then the row above
df.fillna(method='ffill')
np.count_nonzero(df.isnull().values)
np.count_nonzero(df.isnull()) # also works
df.fillna(method='ffill')