numpy 之切片快速理解

Let's practice:

arr = np.arange(0,100,2,int)
a12 = arr.reshape(5,10)
arr24 = a12[:2,:3][:,1:]
arr25 = a12[2:,:3][:2] # 第二行往后 2:
arr36 = a12[:,3:][3:,:3]
arr37 = a12[2:,7:][:2,:2]
print(a12)

 

posted @ 2020-10-30 11:07  PEAR2020  阅读(197)  评论(0编辑  收藏  举报