bundles / numpy 2.4.4 / numpy / lib / _arraypad_impl / _slice_at_axis
function
numpy.lib._arraypad_impl:_slice_at_axis
source: /numpy/lib/_arraypad_impl.py:34
Signature
def _slice_at_axis(sl, axis)Summary
Construct tuple of slices to slice an array in the given dimension.
Parameters
sl: sliceThe slice for the given dimension.
axis: intThe axis to which
slis applied. All other dimensions are left "unsliced".
Returns
sl: tuple of slicesA tuple with slices matching shape in length.
Examples
np._slice_at_axis(slice(None, 3, -1), 1)
⚠Traceback (most recent call last):
File "<doctest numpy.lib._arraypad_impl:_slice_at_axis[0]>", line 1, in <module>
np._slice_at_axis(slice(None, 3, -1), 1)
^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.14.7/x64/lib/python3.14/site-packages/numpy/__init__.py", line 792, in __getattr__
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
AttributeError: module 'numpy' has no attribute '_slice_at_axis'
Aliases
numpy.lib._arraypad_impl._slice_at_axis