pandas查看数据常用方法(以excel为例)
- 开发
- 49
-
目录
1.查看指定行数的数据head()
2. 查看数据表头columns
3.查看索引index
4.指定索引列index_col
5.按照索引排序
6.按照数据列排序sort_values()
7.查看每列数据类型dtypes
8.查看指定行列数据loc
9.查看数据是否为空isnull()
1.查看指定行数的数据head()
(1)数据.head()默认查看五行数据
(2)查看指定行数
数据.head(行数)
2. 查看数据表头columns
数据.columns
3.查看索引index
数据.index
4.指定索引列index_col
pd.read_excel(路径,index_col=“”
5.按照索引排序
pd.read_excel(路径).sort_index()
6.按照数据列排序sort_values()
数据.sort_values("列")
7.查看每列数据类型dtypes
数据.dtypes
8.查看指定行列数据loc
数据.loc[行][列]
9.查看数据是否为空isnull()
数据.isnull()
True表示空,False表示不为空
原文地址:https://blog.csdn.net/2302_80061155/article/details/135488325
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:https://www.suanlizi.com/kf/1747712900706996224.html
如若内容造成侵权/违法违规/事实不符,请联系《酸梨子》网邮箱:1419361763@qq.com进行投诉反馈,一经查实,立即删除!