numpy.ndarray


there is 2 same list in a list

3x1 and 3x1


f=np.array([[1,2,3],[10,11,12]])


f[a==0, 1]
Out[45]: array([2])


f.shape
Out[46]: (2L, 3L)


#####


there are 2 different list in a list

3x1 and 2x1


f=np.array([[1,2,3],[10.11,12]])


type(f)
Out[40]: numpy.ndarray


f.shape
Out[41]: (2L,)


f[a==0]
Out[42]: array([[1, 2, 3]], dtype=object)


f[a==0, 1]
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-43-07bceb2b55f4> in <module>()
----> 1 f[a==0, 1]


IndexError: too many indices for array

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章