pandas 1.4.2

Parameters
take_1d(arr: 'ArrayLike', indexer: 'npt.NDArray[np.intp]', fill_value=None, allow_fill: 'bool' = True, mask: 'npt.NDArray[np.bool_] | None' = None) -> 'ArrayLike'

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.

Parameters

arr : np.ndarray or ExtensionArray

Input array.

indexer : ndarray

1-D array of indices to take (validated indices, intp dtype).

fill_value : any, default np.nan

Fill value to replace -1 values with

allow_fill : bool, default True

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.

mask : np.ndarray, optional, default None

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 :

Examples

See :

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


File: /pandas/core/array_algos/take.py#170
type: <class 'function'>
Commit: