python dataframe drop if whole column is nan code example Example: python remove nan rows df = df[df['my_var'].notna()]