A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Language/ Library | Method | In-place or Return a Copy | Argument to Switch Sort Order to Descending | Type of Sort | Other Arguments | Notes | Default Axis | ||||||||||||||||||||||
2 | Python (vanilla) | my_list.sort() | In-place | reverse = True | timsort | key | For lists only. | n/a | ||||||||||||||||||||||
3 | Python (vanilla) | my_list = sorted(my_iterable) | Copy | reverse = True | timsort | key | For any iterable. | n/a | ||||||||||||||||||||||
4 | Numpy | my_ndarray.sort() | In-place | n/a - do outside with [::-1] | Default is quicksort. Alternative options: kind : ‘mergesort’, ‘heapsort’, ‘stable’. | axis=-1, kind='quicksort', order=None. | Quicksort is now introsort, which becomes heapsort if slow. Stable is mapped to mergesort. Mergesort doesn't use a mergesort. It uses timsort or radix sort under the hood, depening upon the data type. | last axis | ||||||||||||||||||||||
5 | Numpy | np.sort(my_array) | Copy | n/a - do outside with [::-1] | Default is quicksort Alternative options: kind : ‘mergesort’, ‘heapsort’, ‘stable’. | axis=-1, kind='quicksort', order=None. | Quicksort is now introsort, which becomes heapsort if slow. Stable is mapped to mergesort. Mergesort doesn't use a mergesort. It uses timsort or radix sort under the hood, depening upon the data type. | last axis | ||||||||||||||||||||||
6 | Pandas | df = df.sort_values(by='my_column') | Copy (unless inplace=True) | ascending = False | Default is numpy quicksort. Alternative options: kind : ‘mergesort’, ‘heapsort’, ‘stable’. | by, axis=0, inplace=False, kind='quicksort', na_position='last. | For DataFrame and Series. Uses Numpy for sorting under the hood. | last axis | ||||||||||||||||||||||
7 | TensorFlow | tf.sort(my_values) | Copy | direction = 'DESCENDING' | Finds the largest value in the tensor using top_k(). Uses CUB Cuda library, which wraps thrust, for parallel sort with GPU for large cases; algorithms vary - e.g. merge sort, radix sort. | last axis | ||||||||||||||||||||||||
8 | PyTorch | torch.sort(my_values) | Copy | descending = True | Uses thrust CUDA library for parallel sort with GPU for large cases; algorithms vary - e.g. merge sort, radix sort. | last axis | ||||||||||||||||||||||||
9 | SQL | ORDER BY my_column | Copy | DESC | Varies. Postgres uses a disk merge sort, quick sort, or heap sort depending upon the situation. | n/a | ||||||||||||||||||||||||
10 | ||||||||||||||||||||||||||||||
11 | ||||||||||||||||||||||||||||||
12 | ||||||||||||||||||||||||||||||
13 | ||||||||||||||||||||||||||||||
14 | ||||||||||||||||||||||||||||||
15 | ||||||||||||||||||||||||||||||
16 | ||||||||||||||||||||||||||||||
17 | ||||||||||||||||||||||||||||||
18 | ||||||||||||||||||||||||||||||
19 | ||||||||||||||||||||||||||||||
20 | ||||||||||||||||||||||||||||||
21 | ||||||||||||||||||||||||||||||
22 | ||||||||||||||||||||||||||||||
23 | ||||||||||||||||||||||||||||||
24 | ||||||||||||||||||||||||||||||
25 | ||||||||||||||||||||||||||||||
26 | ||||||||||||||||||||||||||||||
27 | ||||||||||||||||||||||||||||||
28 | ||||||||||||||||||||||||||||||
29 | ||||||||||||||||||||||||||||||
30 | ||||||||||||||||||||||||||||||
31 | ||||||||||||||||||||||||||||||
32 | ||||||||||||||||||||||||||||||
33 | ||||||||||||||||||||||||||||||
34 | ||||||||||||||||||||||||||||||
35 | ||||||||||||||||||||||||||||||
36 | ||||||||||||||||||||||||||||||
37 | ||||||||||||||||||||||||||||||
38 | ||||||||||||||||||||||||||||||
39 | ||||||||||||||||||||||||||||||
40 | ||||||||||||||||||||||||||||||
41 | ||||||||||||||||||||||||||||||
42 | ||||||||||||||||||||||||||||||
43 | ||||||||||||||||||||||||||||||
44 | ||||||||||||||||||||||||||||||
45 | ||||||||||||||||||||||||||||||
46 | ||||||||||||||||||||||||||||||
47 | ||||||||||||||||||||||||||||||
48 | ||||||||||||||||||||||||||||||
49 | ||||||||||||||||||||||||||||||
50 | ||||||||||||||||||||||||||||||
51 | ||||||||||||||||||||||||||||||
52 | ||||||||||||||||||||||||||||||
53 | ||||||||||||||||||||||||||||||
54 | ||||||||||||||||||||||||||||||
55 | ||||||||||||||||||||||||||||||
56 | ||||||||||||||||||||||||||||||
57 | ||||||||||||||||||||||||||||||
58 | ||||||||||||||||||||||||||||||
59 | ||||||||||||||||||||||||||||||
60 | ||||||||||||||||||||||||||||||
61 | ||||||||||||||||||||||||||||||
62 | ||||||||||||||||||||||||||||||
63 | ||||||||||||||||||||||||||||||
64 | ||||||||||||||||||||||||||||||
65 | ||||||||||||||||||||||||||||||
66 | ||||||||||||||||||||||||||||||
67 | ||||||||||||||||||||||||||||||
68 | ||||||||||||||||||||||||||||||
69 | ||||||||||||||||||||||||||||||
70 | ||||||||||||||||||||||||||||||
71 | ||||||||||||||||||||||||||||||
72 | ||||||||||||||||||||||||||||||
73 | ||||||||||||||||||||||||||||||
74 | ||||||||||||||||||||||||||||||
75 | ||||||||||||||||||||||||||||||
76 | ||||||||||||||||||||||||||||||
77 | ||||||||||||||||||||||||||||||
78 | ||||||||||||||||||||||||||||||
79 | ||||||||||||||||||||||||||||||
80 | ||||||||||||||||||||||||||||||
81 | ||||||||||||||||||||||||||||||
82 | ||||||||||||||||||||||||||||||
83 | ||||||||||||||||||||||||||||||
84 | ||||||||||||||||||||||||||||||
85 | ||||||||||||||||||||||||||||||
86 | ||||||||||||||||||||||||||||||
87 | ||||||||||||||||||||||||||||||
88 | ||||||||||||||||||||||||||||||
89 | ||||||||||||||||||||||||||||||
90 | ||||||||||||||||||||||||||||||
91 | ||||||||||||||||||||||||||||||
92 | ||||||||||||||||||||||||||||||
93 | ||||||||||||||||||||||||||||||
94 | ||||||||||||||||||||||||||||||
95 | ||||||||||||||||||||||||||||||
96 | ||||||||||||||||||||||||||||||
97 | ||||||||||||||||||||||||||||||
98 | ||||||||||||||||||||||||||||||
99 | ||||||||||||||||||||||||||||||
100 |