pandas dataframe empty nan code example
Example 1: drop if nan in column pandas
df = df[df['EPS'].notna()]
Example 2: pandas replace empty string with nan
df = df.replace(r'^\s*$', np.NaN, regex=True)
df = df[df['EPS'].notna()]
df = df.replace(r'^\s*$', np.NaN, regex=True)