how to check if a datafram has nan or inf values in pandas code example
Example 1: dataframe find nan rows
df[df.isnull().any(axis=1)]
Example 2: check if a value in dataframe is nan
#return a subset of the dataframe where the column name value == NaN
df.loc[df['column name'].isnull() == True]