[Numpy-discussion] A proposed change to rollaxis() behavior for negative 'start' values

Bradley M. Froehle brad.froehle@gmail....
Sat Feb 16 12:45:52 CST 2013


Have you considered using .transpose(...) instead?

In [4]: a = numpy.ones((3,4,5,6))

In [5]: a.transpose(2,0,1,3).shape
Out[5]: (5, 3, 4, 6)

In [6]: a.transpose(0,2,1,3).shape
Out[6]: (3, 5, 4, 6)

In [7]: a.transpose(0,1,2,3).shape
Out[7]: (3, 4, 5, 6)

In [8]: a.transpose(0,1,3,2).shape
Out[8]: (3, 4, 6, 5)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130216/e47341dc/attachment.html 


More information about the NumPy-Discussion mailing list