pandas dataframe is nan code example Example: to detect if a data frame has nan values df.isnull().sum().sum() 5