[73]: arr[:,1]
Out[73]:
array([[ 5, 6, 7, 8, 9],
[20, 21, 22, 23, 24]])
# 异常指出 axis = 1 超出范围..., 16],
[20, 21],
[25, 26]]])
In [79]: arr[:,:,0:2].shape
Out[79]: (2, 3, 2)
# 左/右侧超出范围...Int64IndexOut[172]: Int64Index([2, 3, 4], dtype='int64')
# 索引为字符串In [168]: df = pd.DataFrame({'a':...当使用字符串时切片时是 []区间 ,一般是 [)区间
当在numpy.ndarry、list、tuple、pandas.Series、pandas.DataFrame 混合使用时,采用变量进行索引或者切割...我在工程中使用matlab的矩阵和python混合使用以上对象,出现最多就是shape不对应,index,columns 错误。