pandas clean nan code example Example 1: dropping nan in pandas dataframe df.dropna(subset=['name', 'born']) Example 2: delete nans in df python df[~np.isnan(df)]