python num[y array

时间:2021-05-08 02:49:21

http://sebug.net/paper/books/scipydoc/numpy_intro.html

npArr1=np.array([1,2,3],[4,5,6],[7,8,9]])

npArr1[0]  #0th row

npArr1[0][1] #oth row ,1stcolumn

npArr1[:,0] #0column

>>> npArr2[0:2,1] #1th column, 0,1 row
array([2, 4])

相关文章