pandas.api.extensions.ExtensionArray.sort

pandas 3.1.1 · Extensions · method

Reorder the extension array in place with the requested sort direction and missing-value placement. Immutable implementations can reject this operation.

Call syntax

pd.api.extensions.ExtensionArray.sort(*, ascending=True, kind='quicksort', na_position='last')

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
ascending Optional
Keyword only
Default True
bool

Choose ascending or descending order. Some sorting methods take one flag per sort key.

kind Optional
Keyword only
Default 'quicksort'
{'quicksort', 'mergesort', 'heapsort', 'stable'}

Choose the implementation variant, such as a sort algorithm or a plot type.

na_position Optional
Keyword only
Default 'last'
{'first', 'last'}

Place missing values first or last in the result.

Returns

None