[Numpy-discussion] indexing question
Faheem Mitha
faheem at email.unc.edu
Sat Mar 27 16:28:00 EST 2004
On Sat, 27 Mar 2004, Todd Miller wrote:
> Try foo[[0,2]]. Note that the array indexing syntax is a little picky:
> foo[(0,2)] (tuple index) won't work, just foo[[0,2]] (list index) or
> foo[array([0,2])] (array index).
Thanks. I see this extracts the relevant rows. How about columns? Also,
where is this documented? I spent quite a while poring over the numarray
documentation. The section on index arrays looked relevant but I found it
difficult to understand.
Faheem.
More information about the NumPy-Discussion
mailing list