# Questions tagged [sorting]

Questions on the sorting/ordering functions of Mathematica (Sort, SortBy, Ordering, etc.).

376 questions
Filter by
Sorted by
Tagged with
69 views

### Ordered list of integer vectors

For a given length $n$ and a maximum positive integer value $N$, I'd like to generate a list that contains all $n$-vectors with entries between $-N$ and $N$ (of which there are $(2N+1)^n$. Further, ...
84 views

### Dropping non-commutative product in the end

Suppose my expressions are given as a combinations of non-commutative products, i.e., $2 X**Y**Z + 3 Y**Z**X$, I want to make this as commutative product and get $5 X**Y**Z$. And want similar things ...
70 views

86 views

### Concise way to do lexicographic ordering

I want to order a bunch of number sequences lexicographically. Did this with ...
26 views

### ordered set inclusion 2

Slightly change the previous question, ordered set inclusion, Now, consider $A=\{2,3\}$ and $B=\{2,3,4,5\}, C=\{5,2,4,3\}$, Now I want to make element $\{2,3\}$ is in $B$ as well as $C$, what can be ...
80 views

### How to reorder {x,y} list data and plot as ListLinePlot

How to re-arrange data to find line plot in order (I tried with given below code). ...
1 vote
57 views

### Sorting a Dataset by an enumerated column with assigned values

A $\mathtt{Dataset}$ has a column $C$ with enumerated values $c_i$, to each of which a number $n_{c_i}$ is manually assigned. The $\mathtt{Dataset}$ needs to be sorted based on the numbers. MWE: ...
181 views

### Stop Canonical Ordering of Output List

I'm working with the code below, which works well for my purposes; however, instead of the canonical ordering seen in the output, I want the output produced in the order I give in the Cases line of ...
1 vote