[Numpy-discussion] Generalized flip function

Eren Sezener erensezener at gmail.com
Fri Feb 26 11:32:35 EST 2016


Hi,

In PR #7346 we add a flip function that generalizes fliplr and flipud for
arbitrary axes.

flipud and fliplr reverse the elements of an array along axis=0 and axis=1
respectively. The new flip function reverses the elements of an array along
any given axis. In case flip is called with axis=0 or axis=1, the function
is equivalent to flipud and fliplr respectively.

A similar function is also available in MATLAB™.

We use this function in PR #7347 to generalize the rot90 function to rotate
an arbitrary plane (defined by the axes argument) of a multidimensional
array. By that we fix issue #6506.

Because flip function introduces a new API, @shoyer asked us to consult the
mailing list.

Any objection to adding the generalized flip function?

Best regards,
C. Eren Sezener & Denis Alevi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160226/0630eb45/attachment.html>


More information about the NumPy-Discussion mailing list