#查找缺失值函数
def find_nan(df):
    all_count=len(sh_car)
    nan_lists={}
    for col in df.columns:
        if df[col].isnull().sum():
                nan_lists[col]=df[col].isnull().sum()
    for k,v in nan_lists.items():
        print('变量 "{}"  \t 共有 {} 笔缺失值\t 占比为 {:.4f}%'.format(k,v,v/all_count))

感谢
https://www.jianshu.com/p/9f583668f386

def check_missing_data(df):
    return df.isnull().sum().sort_values(ascending=False)

感谢
https://www.cnblogs.com/Mrzhang3389/p/11166800.html

相关文章:

  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
猜你喜欢
  • 2021-05-03
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案