Find out the percentage of missing values in each column in the given dataset

前端 未结 11 1120
逝去的感伤
逝去的感伤 2021-01-31 08:38
import pandas as pd
df = pd.read_csv(\'https://query.data.world/s/Hfu_PsEuD1Z_yJHmGaxWTxvkz7W_b0\')
percent= 100*(len(df.loc[:,df.isnull().sum(axis=0)>=1 ].index) / l         


        
11条回答
  •  遥遥无期
    2021-01-31 09:30

    single line solution

    df.isnull().mean().round(4).mul(100).sort_values(ascending=False)
    

提交回复
热议问题