Normalizes an axis argument into a tuple of non-negative integer axes.
This handles shorthands such as 1 and converts them to (1,), as well as performing the handling of negative indices covered by normalize_axis_index.
By default, this forbids axes from being specified multiple times.
Used internally by multi-axis-checking logic.
The un-normalized index or indices of the axis.
The number of dimensions of the array that axis should be normalized against.
A prefix to put before the error message, typically the name of the argument.
If False, the default, disallow an axis from being specified twice.
The normalized axis index, such that 0 <= normalized_axis < ndim
If any axis provided is out of range
If an axis is repeated
See also
normalize_axis_indexnormalizing a single scalar axis
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.lib.array_utils.normalize_axis_tuple.html