[Numpy-discussion] matrix indexing question

Alan G Isaac aisaac at american.edu
Sun Mar 25 22:30:32 EDT 2007


Oooops, they should match of course. ::
    >>> X[1]
    array([3,4])
    >>> X[1,:]
    matrix([[3, 4]])

But again the point is:
indexing for submatrices should produce matrices.
Normal Python indexing should access the constituent arrays.

Cheers,
Alan Isaac







More information about the NumPy-Discussion mailing list