python pandas (ix & iloc &loc) 的区别
来源:互联网 发布:2017网络热点 编辑:程序博客网 时间:2024/06/05 06:45
loc——通过行标签索引行数据
iloc——通过行号索引行数据
ix——通过行标签或者行号索引行数据(基于loc和iloc 的混合)
同理,索引列数据也是如此!
举例说明:
1、分别使用loc、iloc、ix 索引第一行的数据:
(1)loc
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
(2)iloc
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
(3)ix
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
2、分别使用loc、iloc、ix 索引第一列的数据:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
3、分别使用loc、iloc、ix 索引多行的数据:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
4、分别使用loc、iloc、ix 索引多列的数据:
转载自:http://blog.csdn.net/hecongqing/article/details/61927615
阅读全文
0 0
- python pandas (ix & iloc &loc) 的区别
- python pandas (ix & iloc &loc) 的区别
- python pandas (ix & iloc &loc) 的区别
- python pandas (ix & iloc &loc) 的区别
- python pandas中ix,iloc,loc的区别
- Pandas的 loc iloc ix 区别
- pandas中loc、iloc、ix的区别
- pandas中loc iloc ix的区别
- Pandas的 loc iloc ix 区别
- pandas中ix loc iloc的区别
- Pandas的 loc iloc ix 区别
- Pandas的 loc iloc ix 区别
- Pandas中loc,iloc,ix的区别
- Pandas中iloc和loc以及ix的区别
- Pandas中loc,iloc和ix的区别
- python pandas中的ix,loc和iloc
- python库学习笔记——Pandas数据索引:ix、loc、iloc区别
- Pandas——ix vs loc vs iloc区别
- 前端下载的实现
- 一个“老”程序员在阿里、百度、58赶集、美团等公司面试经验总结
- MySql的内连、左连、右连 用法及区别
- 关于安装在VirtualBox中ubuntu共享文件夹的问题
- JavaLombok
- python pandas (ix & iloc &loc) 的区别
- 生成当前日期开头加0001,0002,0003......的方法
- switch case 1
- iOS CoreBluetooth
- 数据库索引是什么,是怎样工作的?
- JavaWeb例程二
- git切换分支(远程)
- numpy.eye() 生成对角矩阵
- 第二章 Java程序设计环境