[Numpy-discussion] .T Transpose shortcut for arrays again

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Jul 6 15:37:27 EDT 2006


On 7/6/06, Tim Hochberg <tim.hochberg at cox.net> wrote:
> ...
> Overloading '+' sure seems perverse, but maybe that's just me.
>
The first time I saw it, it seemed perverse to me as well, but it
actually make a lot of sense:

1. It is visually appealing as in  '+' makes '|' from '-' and '-' from
'|' and looks close enough to 't'.
2. It puts an otherwise useless operator to work.
3. Prefix spelling suggests that it should be swapaxes(0,1) rather
than swapaxes(-2,-1), which is the choice made by K.
4. You can't get any shorter than that (at least using a fixed width font :-).
5. It already does the right thing for rank<2.




More information about the NumPy-Discussion mailing list