二维数组单元信息操作
为什么查询列信息写成1:23也不会报错?In [85]: arraytest5[0:5,1:4]
Out[85]:
array([[10],
[20],
[30],
[40],
[50]])
In [86]: arraytest5
Out[86]:
array([[ 4, 10],
[12, 20],
[20, 30],
[28, 40],
[36, 50]])
In [87]: arraytest5[0:5,1:1]
Out[87]: array([], shape=(5, 0), dtype=int64)
In [88]: arraytest5[0:5,1:10]
Out[88]:
array([[10],
[20],
[30],
[40],
[50]])
In [89]: arraytest5[0:5,0:10]
Out[89]:
array([[ 4, 10],
[12, 20],
[20, 30],
[28, 40],
[36, 50]])
In [90]: arraytest5[0:5,0:1]
Out[90]:
array([[ 4],
[12],
[20],
[28],
[36]])
In [91]: arraytest5[0:5,0:0]
Out[91]: array([], shape=(5, 0), dtype=int64)
In [92]: arraytest5[0:5,0:1]
Out[92]:
array([[ 4],
[12],
[20],
[28],
[36]])
In [93]: arraytest5[0:5,1:0]
Out[93]: array([], shape=(5, 0), dtype=int64)
In [94]: arraytest5[0:5,1:1
...: ]
Out[94]: array([], shape=(5, 0), dtype=int64)
In [95]: arraytest5[0:5,1:]
Out[95]:
array([[10],
[20],
[30],
[40],
[50]])
In [96]: arraytest5[0:5,1:2]
Out[96]:
array([[10],
[20],
[30],
[40],
[50]])
In [97]: arraytest5[0:5,1:23
...: ]
Out[97]:
array([[10],
[20],
[30],
[40],
[50]])
[此贴子已经被作者于2019-11-13 17:27编辑过]