[Matrix-SIG] [PSA MEMBERS] Numeric Python Set function
David Ascher
David Ascher <da@skivs.ski.org>
Tue, 9 Jun 1998 14:44:11 -0700 (PDT)
On Mon, 8 Jun 1998, Janko Hauser wrote:
> Am I right, that these forms of indexing are only possible with a
> ravel(a) array? Isn't it possible to expand the slice type, so one can
> define indexes along each dimension? (give me any row, where soem
> value is bigger than 10)
No and yes, respectively.
x[sometrue(x>10)] or x[sometrue(swapaxes(x,0,N) > 10)]
or some other variant for higher rank forms should work.
Isn't this just a 'mask' variant?
as far as multiple axes is concerned, there's nothing to prevent something
like:
x[x>100,sin(x)==1,:,NewAxis] = 3
from working. The hard part is determining what 'working' means. =)
> If the slice type defines something like this other sequence objects
> can start to use this way of indexing with the definition of an
> additional method (is it getitem or getslice?).
I'm not sure I understand this sentence.
--david