Numpy [数组切片] In [115]: a = np.arange(12).reshape((3,4)) In [116]: a Out[116]: array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) In [117]: a[1:,1:3] Out[117]: array([[ 5, 6], [ 9, 10]]) In [118]: [布尔值索引]找出数据中大于5的元素 In [134]: a = [ random.randint(