0

df.isnull().count()

Output - 740 (Displaying the opposite)

df.isnull().sum()

Output - 8 (Displaying the null values)

PS : 'df' is the name of my dataset

  • 2
    `pd.Series([True,False]).sum()` gives the sum of the True (boolean) whereas `pd.Series([True,False]).count()` counts all the values True and False hence you get the full count of the length of the dataframe not only the count of True – anky Apr 04 '21 at 14:38
  • @anky, Thanks a ton ! – Muralimanohar Apr 04 '21 at 14:41
  • Related : https://stackoverflow.com/questions/12765833/counting-the-number-of-true-booleans-in-a-python-list – anky Apr 04 '21 at 15:01

0 Answers0