pandas.Index.take

pandas 3.1.1 · Index objects · method

Select values by integer position in the order supplied.

Call syntax

Index.take(indices, axis=0, allow_fill=…, fill_value=…, **kwargs)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
indices Required
Positional or keyword
array-like

Supply the integer positions selected from the input.

axis Optional
Positional or keyword
Default 0
{0 or 'index'}

Choose which axis the operation acts on. The accepted axis labels depend on the receiver.

allow_fill Optional
Positional or keyword
bool
fill_value Optional
Positional or keyword
scalar

Supply a value to use in place of a missing position.

**kwargs Optional
Additional keyword arguments

Returns

Index