4
在列的特定範圍我有一個數組:提取numpy的陣列的Python
e = np.array([[ 0, 1, 2, 3, 5, 6, 7, 8],
[ 4, 5, 6, 7, 5, 3, 2, 5],
[ 8, 9, 10, 11, 4, 5, 3, 5]])
欲通過它的列在RANGE提取數組,如果我想利用在範圍1列直到5,它將返回
e = np.array([[ 1, 2, 3, 5, ],
[ 5, 6, 7, 5, ],
[ 9, 10, 11, 4, ]])
如何解決?謝謝
我想你的意思是'E [:,1:5]'。 – farenorth
@ farenorth你說得對。 – whbb