import numpy as npa = np.array([[1,2,3,4],[5,6,7,8]])a[0:1,2:3] # 连续索引Out[10]: array([[3]])a[0:2,1:3]Out[11]: array([[2, 3], [6, 7]])