NumPy 高级索引NumPy 比一般的Python 序列提供更多的索引方式。 ... import numpy as np x = np.array([[1, 2], [3, 4], [5, 6]]) y = x[[0,1,2], [0,1,0]] print (y).
確定! 回上一頁