栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

删除Pandas数据框中的NaN / NULL列?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

删除Pandas数据框中的NaN / NULL列?

是的

dropna
。请参阅http://pandas.pydata.org/pandas-
docs/stable/missing_data.html
Dataframe.dropna
文档字符串:

Definition: Dataframe.dropna(self, axis=0, how='any', thresh=None, subset=None)Docstring:Return object with labels on given axis omitted where alternately anyor all of the data are missingParameters----------axis : {0, 1}how : {'any', 'all'}    any : if any NA values are present, drop that label    all : if all values are NA, drop that labelthresh : int, default None    int value : require that many non-NA valuessubset : array-like    Labels along other axis to consider, e.g. if you are dropping rows    these would be a list of columns to includeReturns-------dropped : Dataframe

要运行的特定命令为:

df=df.dropna(axis=1,how='all')


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/625289.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号