| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add `ArrayBase::rot90(k, axes)`, the equivalent of NumPy's `numpy.rot90`. It rotates the array `k` times by 90 degrees in the plane spanned by the two given axes, going from `axes.0` toward `axes.1`. Like the existing axis-manipulation methods it moves no data, only adjusting the dimensions and strides via `swap_axes`/`invert_axis`. `k` is reduced modulo 4 with `rem_euclid`, so negative values rotate in the opposite direction. Closes rust-ndarray#866.
| Back | FazBrowse Home | New Git URL |
What
Adds a new public method ArrayBase::rot90(k, axes) that rotates an array by 90 degrees k times in the plane spanned by two axes, mirroring NumPy's numpy.rot90.
Why
There is currently no built-in equivalent to np.rot90; users have to hand-compose swap_axes/invert_axis (or multiply by a flipped identity matrix). Issue #866 (help-wanted) requests it, and a maintainer asked for a volunteer to implement the full NumPy-equivalent including the k and axes parameters.
Testing
Fixes #866.