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