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' })
Scope
dataFrame
Family
column
Returns
mutates

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
type (string)
The sort type:
  • Alpha-numeric: alphanumeric (default)
  • Numeric: number
  • Texte: string

Example

// sort a dataFrame column 'revenue' containing numbers
dataFrame.column('revenue').sort({ type: 'numeric', order: 'asc' });