[Numpy-discussion] Syntax Improvement for Array Transpose

Sebastian Berg sebastian at sipsolutions.net
Sun Jun 23 17:19:54 EDT 2019


On Sun, 2019-06-23 at 23:03 +0200, Andras Deak wrote:
> On Sun, Jun 23, 2019 at 10:37 PM Sebastian Berg
> <sebastian at sipsolutions.net> wrote:
> > Yeah, likely worth a short. I doubt many uses for the n-dimensional
> > axis transpose, so maybe a futurewarning approach can work. If not,
> > I
> > suppose the solution is the deprecation for ndim != 2.
> 
> Any chance that the n-dimensional transpose is being used in code
> interfacing fortran/matlab and python? One thing the current
> multidimensional transpose is good for is to switch between row-major
> and column-major order. I don't know, however, whether this switch
> actually has to be done often in code, in practice.
> 

I suppose there is a chance for that, to fix the order for returned
arrays (for input arrays you probably need to fix the memory order, so
that `copy(..., order="F")` or `np.ensure` is more likely what you
want.

Those users should be fine to switch over to `arr.transpose()`. The
question is mostly if it hits so much code that it is painful.

- Sebastian



> András
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190623/4aabda83/attachment-0001.sig>


More information about the NumPy-Discussion mailing list