{ } Raw JSON

bundles / astropy 7.0.1 / astropy / utils / shapes / simplify_basic_index

function

astropy.utils.shapes:simplify_basic_index

source: /astropy/utils/shapes.py :429

Signature

def   simplify_basic_index ( basic_index : int | slice | Sequence[int | slice | EllipsisType | None] * shape : Sequence[int] )  →  tuple[int | slice, ...]

Summary

Given a Numpy basic index, return a tuple of integers and slice objects with no default values (None) if possible.

Extended Summary

If one of the dimensions has a slice and the step is negative and the stop value of the slice was originally None, the new stop value of the slice may still be set to None.

For more information on valid basic indices, see https://numpy.org/doc/stable/user/basics.indexing.html#basic-indexing

Parameters

basic_index

A valid Numpy basic index

shape

The shape of the array being indexed

Aliases

  • astropy.utils.simplify_basic_index