[Numpy-discussion] Question about indexing
Alan G Isaac
Thu May 29 22:50:38 CDT 2008
>> On Thu, 29 May 2008, Keith Goodman apparently wrote:
>>> That one looks odd. But it is just shorthand for:
> On Thu, May 29, 2008 at 6:32 PM, Alan G Isaac
> <email@example.com> wrote:
>> Do you mean that ``a[[0,1],:]`` is a more primitive
>> expression than ``a[[0,1]]``? In what sense, and does it
>> ever matter?
>> Is ``a[[0,1]]`` completely equivalent to ``a[[0,1],...]``
>> and ``a[[0,1],:]``?
On Thu, 29 May 2008, Keith Goodman apparently wrote:
> I can see how the difference between
> is not obvious at first, especially if you come from octave/matlab.
> The first example has an obvious i and j. But the second
> example doesn't. So I tried to point out that i=[0,1] and
My questions were real questions, not rhetorical.
I think the initial mind-bender is the difference between
a[(0,1)] and a[[0,1]]. The latter might also be
written a[[0,1],], which I think links to your point.
More information about the Numpy-discussion