dataFrame — sort()
Description
The sort() method of the column object replaces all rows in the DataFrame with the specified values.
Signature
dataFrame.column(columnName).sort({ order: 'asc', type: 'alphanumeric' })Argument
columnName(string)- The name of the column used for sorting.
options(object)- Sorting options.
Options
order(string)- The sort order:
- Ascending:
asc(default) - Descending:
desc
- Ascending:
type(string)- The sort type:
- Alpha-numeric:
alphanumeric(default) - Numeric:
number - Texte:
string
- Alpha-numeric:
Example
// sort a dataFrame column 'revenue' containing numbers
dataFrame.column('revenue').sort({ type: 'numeric', order: 'asc' });