pandas.api.extensions.ExtensionArray._values_for_argsort — pandas 2.2.3 documentation (original) (raw)
ExtensionArray._values_for_argsort()[source]#
Return values for sorting.
Returns:
ndarray
The transformed values should maintain the ordering between values within the array.
Notes
The caller is responsible for not modifying these values in-place, so it is safe for implementers to give views on self
.
Functions that use this (e.g. ExtensionArray.argsort
) should ignore entries with missing values in the original array (according toself.isna()
). This means that the corresponding entries in the returned array don’t need to be modified to sort correctly.
Examples
In most cases, this is the underlying Numpy array of the ExtensionArray
:
arr = pd.array([1, 2, 3]) arr._values_for_argsort() array([1, 2, 3])