pandas 1.4.2

ParametersRaisesReturns
take(self: 'IntervalArrayT', indices, *, allow_fill: 'bool' = False, fill_value=None, axis=None, **kwargs) -> 'IntervalArrayT'

Parameters

indices : sequence of integers

Indices to be taken.

allow_fill : bool, default False

How to handle negative values in :None:None:`indices`.

  • False: negative values in :None:None:`indices` indicate positional indices from the right (the default). This is similar to numpy.take .

  • True: negative values in :None:None:`indices` indicate missing values. These values are set to :None:None:`fill_value`. Any other other negative values raise a ValueError .

fill_value : Interval or NA, optional

Fill value to use for NA-indices when allow_fill is True. This may be None , in which case the default NA value for the type, self.dtype.na_value , is used.

For many ExtensionArrays, there will be two representations of :None:None:`fill_value`: a user-facing "boxed" scalar, and a low-level physical NA value. :None:None:`fill_value` should be the user-facing version, and the implementation should handle translating that to the physical version for processing the take if necessary.

axis : any, default None

Present for compat with IntervalIndex; does nothing.

Raises

IndexError

When the indices are out of bounds for the array.

ValueError

When :None:None:`indices` contains negative values other than -1 and allow_fill is True.

Returns

IntervalArray

Take elements from the IntervalArray.

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/arrays/interval.py#1002
type: <class 'function'>
Commit: