2019-03-22
阅读量:
932
Python 基本操作- 数据选取iloc函数
iloc 主要是通过行号获取行数据,划重点,序号
iloc[0:1],由于Python默认是前闭后开,所以,这个选择的只有第一行!
In[12]: df.iloc[0:1]
Out[12]:
0 1 2 3
0 green M 10.1 class1
如果想用标签索引,如iloc['a'],就会报错,它只支持int型。






评论(0)


暂无数据