Dataframe
 
0.15

sortBy

Edit page Last modified: 14 January 2025

Returns DataFrame with rows sorted by one or several columns.

By default, columns are sorted in ascending order with null values going first. Available modifiers:

  • .desc — changes column sort order from ascending to descending

  • .nullsLast — forces null values to be placed at the end of the order

df.sortBy { age }
df.sortBy { age and name.firstName.desc() }
df.sortBy { weight.nullsLast() }