find nan in dataset code example Example: to detect if a data frame has nan values df.isnull().sum().sum() 5