normalize_axis_index(axis, ndim, msg_prefix=None)
Used internally by all axis-checking logic.
The un-normalized index of the axis. Can be negative
The number of dimensions of the array that :None:None:`axis`
should be normalized against
A prefix to put before the message, typically the name of the argument
If the axis index is invalid, when :None:None:`-ndim <= axis < ndim`
is false.
The normalized axis index, such that :None:None:`0 <= normalized_axis < ndim`
Normalizes an axis index, :None:None:`axis`
, such that is a valid positive index into the shape of array with ndim
dimensions. Raises an AxisError with an appropriate message if this is not possible.
>>> normalize_axis_index(0, ndim=3) 0This example is valid syntax, but we were not able to check execution
>>> normalize_axis_index(1, ndim=3) 1This example is valid syntax, but we were not able to check execution
>>> normalize_axis_index(-1, ndim=3) 2This example is valid syntax, but we were not able to check execution
>>> normalize_axis_index(3, ndim=3) Traceback (most recent call last): ... AxisError: axis 3 is out of bounds for array of dimension 3This example is valid syntax, but we were not able to check execution
>>> normalize_axis_index(-4, ndim=3, msg_prefix='axes_arg') Traceback (most recent call last): ... AxisError: axes_arg: axis -4 is out of bounds for array of dimension 3See :
The following pages refer to to this document either explicitly or contain code examples using this.
numpy.core.numeric.normalize_axis_tuple
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them