broadcast_for_index

function of dascore.utils.misc source

broadcast_for_index(
    n_dims: int ,
    axis: int | collections.abc.Sequence[int, collections.abc.Sequence[int]] ,
    value: slice | int | None[<class ’slice, int, None] ,
    fill = slice(None, None, None),
)

For a given shape of array, return empty slices except for slice axis.

Parameters

Parameter Description
n_dims The number of dimensions in the array that will be indexed.
axis The axis number.
value A slice object.
fill The default values for non-axis entries.