pandas drop_duplicates if column is not nan code example
Example 1: drop if nan in column pandas
df = df[df['EPS'].notna()]
Example 2: drop duplicate rows pandas except nan
df[(~df.duplicated()) | (df['col'].isnull())]
df = df[df['EPS'].notna()]
df[(~df.duplicated()) | (df['col'].isnull())]