python num[y array

zyip發表於2015-01-01

 

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])

 

相關文章