From 5b0069c08d00e871d74c6533e0b0eeb3107e8f70 Mon Sep 17 00:00:00 2001 From: Jeff Hale Date: Sat, 13 Jul 2019 16:20:22 -0500 Subject: DOC: improve np.sort docstring (#13968) * improve language around sorting --- numpy/core/fromnumeric.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'numpy/core/fromnumeric.py') diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 08f17aae4..3389e7d66 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -908,14 +908,18 @@ def sort(a, axis=-1, kind=None, order=None): .. versionadded:: 1.12.0 - quicksort has been changed to an introsort which will switch - heapsort when it does not make enough progress. This makes its - worst case O(n*log(n)). - - 'stable' automatically choses the best stable sorting algorithm - for the data type being sorted. It, along with 'mergesort' is - currently mapped to timsort or radix sort depending on the - data type. API forward compatibility currently limits the + quicksort has been changed to `introsort `_. + When sorting does not make enough progress it switches to + `heapsort `_. + This implementation makes quicksort O(n*log(n)) in the worst case. + + 'stable' automatically chooses the best stable sorting algorithm + for the data type being sorted. + It, along with 'mergesort' is currently mapped to + `timsort `_ + or `radix sort `_ + depending on the data type. + API forward compatibility currently limits the ability to select the implementation and it is hardwired for the different data types. @@ -924,7 +928,7 @@ def sort(a, axis=-1, kind=None, order=None): Timsort is added for better performance on already or nearly sorted data. On random data timsort is almost identical to mergesort. It is now used for stable sort while quicksort is still the - default sort if none is chosen. For details of timsort, refer to + default sort if none is chosen. For timsort details, refer to `CPython listsort.txt `_. 'mergesort' and 'stable' are mapped to radix sort for integer data types. Radix sort is an O(n) sort instead of O(n log n). -- cgit v1.2.1