[Numpy-discussion] Status of numeric3 / scipylite / scipy_core
Travis Oliphant
oliphant at ee.byu.edu
Wed Mar 16 22:33:50 EST 2005
Travis Oliphant wrote:
>
> - Where there is more than one index array, what should replace the
> single-axis subspaces that the indexes are referencing? Remember,
> all of the single-axis subspaces are being replaced with one "global"
> subspace. The current proposal states that this indexing subspace
> should be placed first and the "remaining subspaces" pasted in at the
> end.
>
> Is this acceptable, or can someone see a problem??
Answering my own question...
I think that it makes sense to do a direct subspace replacement whenever
the indexing arrays are right next to each other. In other words, I
would just extend the "one-index array" rule to
"all-consecutive-index-arrays" where of course one index array satisfies
the all-consecutive requirement.
Hence in the previous example:
X[:,ind1,ind2,:,:] would result in a (10,2,3,4,40,50) with the
(20,30)-subspace being replaced by the (2,3,4) indexing subspace.
result[:,i,j,k,:,:] = X[:,ind1[i,j,k],ind2[i,j,k],:,:]
Any other thoughts. (I think I will implement this initially by just
using swapaxes on the current implementation...)
-Travis
More information about the NumPy-Discussion
mailing list