@@ -237,31 +237,21 @@ def isna(self):
237237 """
238238 raise AbstractMethodError (self )
239239
240- def _simple_ndarray (self ):
240+ def _values_for_argsort (self ):
241241 # type: () -> ndarray
242- """Convert the array to a simple ndarray representaiton.
243-
244- Many methods can operate indirectly on a cheap-to-compute array that
245- is somehow representative of the extension array. For example, rather
246- than sorting an ExtensionArray directly, which might be expensive,
247- we could convert the ExtensionArray to a representative ndarray of
248- integers, sort the integers, and perform a ``take``.
249-
250- The coversion between ExtensionArray and the simple ndarray should be
251- strictly monotonic https://en.wikipedia.org/wiki/Monotonic_function,
252- and as cheap to compute as possible.
242+ """Return values for sorting.
253243
254244 Returns
255245 -------
256- values : ndarray
246+ ndarray
247+ The transformed values should maintain the ordering between values
248+ within the array.
257249
258250 See Also
259251 --------
260252 ExtensionArray.argsort
261253 """
262- # Implemnetor note: This method is currently used in
263- # - ExtensionArray.argsort
264-
254+ # Note: this is used in `ExtensionArray.argsort`.
265255 return np .array (self )
266256
267257 def argsort (self , ascending = True , kind = 'quicksort' , * args , ** kwargs ):
@@ -289,11 +279,10 @@ def argsort(self, ascending=True, kind='quicksort', *args, **kwargs):
289279 """
290280 # Implementor note: You have two places to override the behavior of
291281 # argsort.
292- # 1. _simple_ndarray : construct the values passed to np.argsort
282+ # 1. _values_for_argsort : construct the values passed to np.argsort
293283 # 2. argsort : total control over sorting.
294-
295284 ascending = nv .validate_argsort_with_ascending (ascending , args , kwargs )
296- values = self ._simple_ndarray ()
285+ values = self ._values_for_argsort ()
297286 result = np .argsort (values , kind = kind , ** kwargs )
298287 if not ascending :
299288 result = result [::- 1 ]
0 commit comments