pandas drop rows all nan code example
Example 1: drop duplicate rows pandas except nan
df[(~df.duplicated()) | (df['col'].isnull())]
Example 2: drop null rows pandas
df.dropna()
Example 3: python remove nan rows
df = df[df['my_var'].notna()]
df[(~df.duplicated()) | (df['col'].isnull())]
df.dropna()
df = df[df['my_var'].notna()]