take_1d(arr: 'ArrayLike', indexer: 'npt.NDArray[np.intp]', fill_value=None, allow_fill: 'bool' = True, mask: 'npt.NDArray[np.bool_] | None' = None) -> 'ArrayLike'
Assumes input array has already been converted to numpy array / EA
Assumes indexer is already guaranteed to be intp dtype ndarray
Only works for 1D arrays
To ensure the lowest possible overhead.
Note: similarly to take_nd
, this function assumes that the indexer is a valid(ated) indexer with no out of bound indices.
Input array.
1-D array of indices to take (validated indices, intp dtype).
Fill value to replace -1 values with
If False, indexer is assumed to contain no -1 values so no filling will be done. This short-circuits computation of a mask. Result is undefined if allow_fill == False and -1 is present in indexer.
If allow_fill
is True, and the mask (where indexer == -1) is already known, it can be passed to avoid recomputation.
Specialized version for 1D arrays. Differences compared to take_nd
:
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