pandas.Index.union

pandas 3.1.1 · Index objects · method

Combine index labels from both collections into one index.

Call syntax

Index.union(other, sort=None)

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
other Required
Positional or keyword
Index or array-like

Supply the second object or value used in the operation.

sort Optional
Positional or keyword
Default None
bool or None

Choose whether the resulting labels or groups are sorted where supported.

Returns

Index