示例
import numpy as np
X = np.array([[0,1,2,3],[10,11,12,13],[20,21,22,23],[30,31,32,33]])
print(X[0,2])
print(X[1:3,1:3])
print(X[:2,:2])
print(X[:,0])
print(X[...,0:3])
示例
import numpy as np
X = np.array([[0,1,2,3],[10,11,12,13],[20,21,22,23],[30,31,32,33]])
print(X[0,2])
print(X[1:3,1:3])
print(X[:2,:2])
print(X[:,0])
print(X[...,0:3])