ibis.expr.api.TableExpr.sort_by

TableExpr.sort_by(table, sort_exprs)

Sort table by the indicated column expressions and sort orders (ascending/descending)

Parameters
sort_exprssorting expressions
Must be one of:
  • Column name or expression

  • Sort key, e.g. desc(col)

  • (column name, True (ascending) / False (descending))

Returns
sortedTableExpr

Examples

>>> import ibis
>>> t = ibis.table([('a', 'int64'), ('b', 'string')])
>>> ab_sorted = t.sort_by([('a', True), ('b', False)])