filter out all nan pandas code example Example 1: python remove nan rows df = df[df['my_var'].notna()] Example 2: delete nans in df python df[~np.isnan(df)]