How to count nan values in a pandas DataFrame?

前端 未结 7 1874
天涯浪人
天涯浪人 2020-12-18 18:40

What is the best way to account for (not a number) nan values in a pandas DataFrame?

The following code:

import numpy as np
import pandas as pd
dfd =         


        
7条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 19:20

    dfd['a'].isnull().value_counts()
    

    return :

    • (True 695
    • False 60,
    • Name: a, dtype: int64)
    • True : represents the null values count
    • False : represent the non-null values count

提交回复
热议问题