pandas filter nan code example
Example 1: drop if nan in column pandas
df = df[df['EPS'].notna()]
Example 2: filter nulla values only pandas
#Python, pandas
#Obtain a dataframe df containing only the rows where "column1" is null (NaN)
df[df['column1'].isnull()]
Example 3: pandas where retuning NaN
# Try using a loc instead of a where:
df_sub = df.loc[df.yourcolumn == 'yourvalue']
Example 4: select non nan values python
df[~np.isnan(df)]