Tag: sorting

64 votes
19 answers
698 views
How to sort a dataframe by multiple column(s)

I want to sort a data.frame by multiple columns. For example, with the data.frame below I would like to sort b

avatar
Venice
0 1 0 9
asked 07 September, 2021
48 votes
15 answers
435 views
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],

avatar
Nidia
0 1 0 9
asked 07 September, 2021
61 votes
27 answers
1.6K views
How do I sort an NSMutableArray with custom objects in it?

What I want to do seems pretty simple, but I can't find any answers on the web. I have an NSMutableArray

avatar
Stacia
0 1 0 9
asked 07 September, 2021
56 votes
8 answers
446 views
Yii2 data provider default sorting

In Yii 1.1 this code works for default sorting: $dataProvider = new CActiveDataProvider('article',a

avatar
Roger
0 1 0 9
asked 07 September, 2021
53 votes
18 answers
2.6K views
Swift how to sort array of custom objects by property value

lets say we have a custom class named imageFile and this class contains two properties. class imageFile {

avatar
Wilber
0 1 0 9
asked 07 September, 2021
51 votes
9 answers
2.7K views
Swift Beta performance: sorting arrays

I was implementing an algorithm in Swift Beta and noticed that the performance was very poor. After digging de

avatar
Basil
0 1 0 9
asked 07 September, 2021
64 votes
30 answers
721 views
62 votes
6 answers
1.3K views
Preserving order with LINQ

I use LINQ to Objects instructions on an ordered array. Which operations shouldn't I do to be sure the o

avatar
Keila
0 1 0 9
asked 07 September, 2021
60 votes
18 answers
1K views
How do I sort a list of dictionaries by a value of the dictionary?

I have a list of dictionaries and want each item to be sorted by a specific value. Take into consideration the

avatar
Nereida
0 1 0 9
asked 07 September, 2021
48 votes
1 answers
2.7K views
Function not working on c program selection sort

Why this function is not working here? It's not sorting on output. Suppose if I enter 1 4 2 the output is

avatar
Hildegard
0 1 0 9
asked 07 September, 2021
51 votes
30 answers
705 views
Sort a Map<Key, Value> by values

I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values. Since

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
598 views
Sort array of objects by string property value

I have an array of JavaScript objects: var objs = [ { first_nom: 'Lazslo', last_nom: 'Jam

avatar
Daniel
0 1 0 9
asked 07 September, 2021
58 votes
14 answers
2.2K views
How to Sort a Multi-dimensional Array by Value

How can I sort this array by the value of the "order" key? Even though the values are currently sequential, th

avatar
Nereida
0 1 0 9
asked 07 September, 2021