remove rows with nan pandas dataframe code example Example 1: drop null rows pandas df.dropna() Example 2: python remove nan rows df = df[df['my_var'].notna()]