s.indexOut[108]: Index(['a', 'b', 'c', 'd', 'e'], dtype='object')
pandas DataFrame 索引
In [114]: import...: [high, low, open]Index: []In [124]: df.ix[0:0]Out[124]:Empty DataFrame
Columns: [high, low, open]Index...df.loc['2']
KeyError: 'the label [2] is not in the [index]'# 索引 Int64IndexOut[172]: Int64Index([2, 3,..., dtype='object')
# 此处没有报错,千万注意 index 类型In [176]: df.loc['2']Out[176]:
a 1b 4Name: 2, dtype: int64...我在工程中使用matlab的矩阵和python混合使用以上对象,出现最多就是shape不对应,index,columns 错误。