Provided itemgetter(0)
is O(1)
when used with data
, the sort is O(n log n)
both on average and in the worst case.
For more information on the sorting method used in Python, see Wikipedia.
More Related Contents:
- Pythonic way to check if a list is sorted or not
- About Python’s built in sort() method
- Quicksort with Python
- Sorting text file by using Python
- Why is Bubble Sort implementation looping forever?
- heapq with custom compare predicate
- Find elements of array one nearest to elements of array two
- What algorithm does Python’s built-in sort() method use?
- Mergesort with Python
- What is this odd sorting algorithm?
- How do I sort a dictionary by value?
- Python analog of PHP’s natsort function (sort a list using a “natural order” algorithm) [duplicate]
- Rank items in an array using Python/NumPy, without sorting array twice
- Weighted random selection with and without replacement
- What is the fastest way to flatten arbitrarily nested lists in Python? [duplicate]
- Sort list of lists ascending and then descending
- How did Python implement the built-in function pow()?
- How to sort objects by multiple keys?
- Why does my Pandas DataFrame not display new order using `sort_values`?
- How to check whether two lists are circularly identical in Python
- How to test if one string is a subsequence of another? [duplicate]
- Fast prime factorization module
- Why is the cmp parameter removed from sort/sorted in Python3.0?
- Replace list of list with “condensed” list of list while maintaining order
- Making a python user-defined class sortable, hashable
- Sort invariant for numpy.argsort with multiple dimensions
- Python Weighted Random [duplicate]
- Pandas DataFrame sort by categorical column but by specific class ordering
- Python: powerset of a given set with generators [duplicate]
- counting combinations and permutations efficiently