diff options
author | Lakshay Garg <lakshayg@outlook.in> | 2018-03-29 12:39:30 +0530 |
---|---|---|
committer | Lakshay Garg <lakshayg@outlook.in> | 2018-03-29 12:39:30 +0530 |
commit | 4a2891748ab9ac8cafd7aaef10222c761e96f892 (patch) | |
tree | 02af2d738210dd548a746eb0b094488ebeb15538 /numpy/core/fromnumeric.py | |
parent | 14955ccf2a6d838705abb21b237179ecfdbae19f (diff) | |
download | numpy-4a2891748ab9ac8cafd7aaef10222c761e96f892.tar.gz |
Remove NPY_STABLESORT enum
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index ddf3314cf..63279ffb3 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -794,14 +794,13 @@ def sort(a, axis=-1, kind='quicksort', order=None): order. The three available algorithms have the following properties: - =========== ======= ============= ============ ======= - kind speed worst case work space stable - =========== ======= ============= ============ ======= - 'quicksort' 1 O(n^2) 0 no - 'mergesort' 2 O(n*log(n)) ~n/2 yes - 'stable' 2 O(n*log(n)) ~n/2 yes - 'heapsort' 3 O(n*log(n)) 0 no - =========== ======= ============= ============ ======= + =========== ======= ============= ============ ======== + kind speed worst case work space stable + =========== ======= ============= ============ ======== + 'quicksort' 1 O(n^2) 0 no + 'mergesort' 2 O(n*log(n)) ~n/2 yes + 'heapsort' 3 O(n*log(n)) 0 no + =========== ======= ============= ============ ======== All the sort algorithms make temporary copies of the data when sorting along any but the last axis. Consequently, sorting along @@ -830,6 +829,10 @@ def sort(a, axis=-1, kind='quicksort', order=None): 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 is currently mapped to + merge sort. + Examples -------- >>> a = np.array([[1,4],[3,1]]) |