pandas dataframe remove nans code example Example 1: drop null rows pandas df.dropna() Example 2: delete nans in df python df[~np.isnan(df)]