Numpy 笔记(二): 多维数组的切片(slicing)和索引(indexing)

ZMonster at 
目录切片(slicing)操作索引(indexing) 操作最简单的情况获取多个元素切片和索引的同异切片(slicing)操作 import numpy as nparr = np.arange(12)print 'array is:', arrslice_one = arr[:4]print 'slice begins at 0 and ends at 4 is:', slice_oneslice_two = arr[7:10]print 'slice begins at 7 and ends at 10 is:', slice_twoslice_three = arr[0:12:4]pri……