Top "Sorting" questions

Sorting is the process of applying some order to a collection of items.

What's the most efficient way to erase duplicates and sort a vector?

I need to take a C++ vector with potentially a lot of elements, erase duplicates, and sort it. I currently …

c++ sorting vector stl duplicates
Is there an upside down caret character?

I have to maintain a large number of classic ASP pages, many of which have tabular data with no sort …

html sorting user-interface character-encoding character
Python data structure sort list alphabetically

I am a bit confused regarding data structure in python; (),[], and {}. I am trying to sort a simple list, probably …

python list sorting alphabetical
C# list.Orderby descending

I would like to receive a list sorted by 'Product.Name' in descending order. Similar to the function below which …

c# list sorting sql-order-by
Sorting arrays in NumPy by column

How can I sort an array in NumPy by the nth column? For example, a = array([[9, 2, 3], [4, 5, 6], [7, 0, 5]]) I'd like to sort …

python arrays sorting numpy scipy
Sort a list by multiple attributes?

I have a list of lists: [[12, 'tall', 'blue', 1], [2, 'short', 'red', 9], [4, 'tall', 'blue', 13]] If I wanted to sort by one element, …

python sorting
How to keep keys/values in same order as declared?

I have a dictionary that I declared in a particular order and want to keep it in that order all …

python sorting dictionary
Sorting list based on values from another list?

I have a list of strings like this: X = ["a", "b", "c", "d", "e", "f", "g", "h", "i"] Y = [ 0, 1, 1, 0, 1, 2, 2, 0, 1 ] What …

python list sorting
django order_by query set, ascending and descending

How can I order by descending my query set in django by date? Reserved.objects.all().filter(client=client_id).…

python django sorting
pandas groupby sort within groups

I want to group my dataframe by two columns and then sort the aggregated results within the groups. In [167]: df …

python sorting pandas group-by