numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
note

Use one of the two predefined instances :None:None:`index_exp` or :None:None:`s_` rather than directly using :None:None:`IndexExpression`.

For any index combination, including slicing and axis insertion, a[indices] is the same as a[np.index_exp[indices]] for any array a. However, np.index_exp[indices] can be used anywhere in Python code and returns a tuple of slice objects that can be used in the construction of complex index expressions.

Notes

You can do all this with :None:None:`slice()` plus a few special objects, but there's a lot to remember and this version is simpler because it uses the standard array indexing syntax.

Parameters

maketuple : bool

If True, always returns a tuple.

A nicer way to build up index tuples for arrays.

See Also

index_exp

Predefined instance that always returns a tuple: :None:None:`index_exp = IndexExpression(maketuple=True)`.

s_

Predefined instance without tuple conversion: :None:None:`s_ = IndexExpression(maketuple=False)`.

Examples

>>> np.s_[2::2]
slice(2, None, 2)
>>> np.index_exp[2::2]
(slice(2, None, 2),)
>>> np.array([0, 1, 2, 3, 4])[np.s_[2::2]]
array([2, 4])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.array.routines.delete

Local connectivity graph

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


GitHub : /numpy/lib/index_tricks.py#711
type: <class 'type'>
Commit: