Description
This function allows to sort the dataset by one or multiple columns.
Application
Most of the functions don’t ensure a certain order of the data. If for any function you need the data in a certain order you can use this step to sort it according to your requirements. For example, Line Plots or Validation Plots require sorted data, otherwise the line will jump randomly from point to point.
How to use
- Choose the dataset to work on in the field Data.
- Choose the column(s) by which to sort group the dataset in the field sortByColumns.
- You can choose either a single or multiple columns to sort.
- The columns can be numerical and/or categorical.
- The order in which you choose the columns is important! The dataset will be sorted according to the order of the selected columns.
- For each selected column you can choose between ascending or descending sorting order. Ascending is preselected by default.
- The option NaN field controls how missing values (NaN = Not a Number) should be handled. They can either be put before all other data (first) or to the end of the dataset (last). Last is preselected by default.
- You can save the newly sorted dataset under a new name. For this, enable the option Save output under different name.
- Click Apply to execute the sort operation.
Examples
Consider the following dataset with one numerical and one categorical column which is already ordered. This result could be achieved if Column 1
and Column 2
are selected in the field sortByColumns in this order: Column 1
, Column 2
.
ID | Column 1 | Column 2 |
---|---|---|
1 | A | 1 |
2 | A | 2 |
3 | A | 3 |
4 | B | 1 |
5 | B | 2 |
6 | C | 1 |
7 | C | 2 |
8 | C | 3 |
If the order of the selection is changed to Column 2
, Column 1
the resulting table would look like this:
ID | Column 1 | Column 2 |
---|---|---|
1 | A | 1 |
4 | B | 1 |
6 | C | 1 |
2 | A | 2 |
5 | B | 2 |
7 | C | 2 |
3 | A | 3 |
8 | C | 3 |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article