Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

attribute.order

Order a column of numbers: the permutation that puts its values least first (or greatest first), and the values in that order. Equal values keep the order they had. The building block under statistics, rank normalisation and grouped folds.

Inputs

  • values (Column<Float>). The numbers ordered.
  • descending (Bool). Default false. Greatest first.

Outputs

  • permutation: an Int column: for each place of the order, the index of the element that stands there.
  • sorted: a Float column of the values in that order.

Example

local order = g.attribute.order({ values = g.core.column({ values = { 3, 1, 2 }, type = "Float" }) })

order.permutation holds 1, 2, 0 and order.sorted holds 1, 2, 3.