[MATRIX-SIG] reverse of take?

Andrew P. Mullhaupt amullhau@ix.netcom.com
Tue, 01 Jul 1997 14:33:55 -0400


At 05:15 PM 7/1/97 +0200, Konrad Hinsen wrote:
> 
>> This would have shape the concatentaion of a.shape[0],
>> b.shape[:-1] and a.shape[1+b.shape[-1]:] and a[:,b][i,j,k] would be
>> the same as a[i][b[j,k]]
>
>And be the first step to the perlization (or J-ization) of NumPy:
>combinations of funny symbols having a meaning not deducible from
>the meanings of their pieces. Besides, Guido will probably refuse
>any syntax change of that kind!

Me too. I think a better approach to adding flavors/bells/whistles to
indexing is by adding a default argument to the index, as in

    a[i, j, k, hint=flavor_woo_woo_17]

for exceptional cases. This approach works well in S, which means that
is doesn't make bees live in the heads of many naive users.

>First we have to agree on what we want, and that could be difficult...

Yes. This, believe it or not, is the hard part.

>Then do an implementation in a separate module, with function syntax,
>just for testing. In parallel, check with Jim (are you following all
>this?) about the status of the NumPy source code - no point in
>modifying code that is still changing. Finally, put it all together
>and be happy...

Absolutely.

Later,
Andrew Mullhaupt

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________