discard a df line when a nan python code example Example: python remove nan rows df = df[df['my_var'].notna()]