From: Travis O. <oli...@ie...> - 2006-05-17 22:19:17
|
Simon Burton wrote: > On Tue, 16 May 2006 15:15:23 -0400 > Alan G Isaac <ai...@am...> wrote: > > >> 2. How are people using this? I trust that the numarray >> behavior was well considered, but I would have expected >> coordinates to be grouped rather than spread across >> the arrays in the tuple. >> > > The split-tuple is for fancy-indexing. That's how you index a multidimensional array using an array of integers. The output of a.nonzero() is setup to do that so that a[a.nonzero()] works. > Yes, this strikes me as bizarre. > How about we make a new function, eg. argwhere, that > returns an array of indices ? > > argwhere( array( [[0,1],[0,1]] ) ) -> [[0,1],[1,1]] > > I could see the value of this kind of function too. -Travis |