📌  相关文章
📜  查找所有 nan 列 pandas - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:01.868000             🧑  作者: Mango

代码示例1
nan_cols = [i for i in df.columns if df[i].isnull().any()]
print("No. of columns containing null values")
print(len(df.columns[df.isna().any()]))

print("No. of columns not containing null values")
print(len(df.columns[df.notna().all()]))

print("Total no. of columns in the dataframe")
print(len(df.columns))