def find_null_columns(df, features):
"""Locates columns in a pandas dataframe that have no values.
Args:
df: A pandas dataframe containing data.
wanted_feats: A list of string names of columns storing the actual data.
Returns: A list of string names of the null columns.
"""
df_len = len(df)
bad_feats = []
for feat in features:
null_len = len(df[df[feat].isnull()])
if df_len == null_len:
bad_feats.append(feat)
return bad_feats
data_funcs.py 文件源码
python
阅读 39
收藏 0
点赞 0
评论 0
评论列表
文章目录