maxframe.liteframe.LiteFrame.sort#

LiteFrame.sort(by=None, ascending=True, kind='quicksort', na_position='last', parallel_kind='PSRS', psrs_kinds=None)#

Sort the LiteFrame by the specified columns.

Parameters:
  • by (str, list of str, or None) – Column name(s) to sort by. If None, all columns are used.

  • ascending (bool or list of bool, default True) – Sort ascending vs descending. Specify list for multiple sort orders.

  • kind (str, default "quicksort") – Sort algorithm hint (Polars chooses its own algorithm).

  • na_position ({"first", "last"}, default "last") – Where to place null values in the sort order.

  • parallel_kind (str, default "PSRS") – Parallel sort algorithm. Only “PSRS” is supported.

  • psrs_kinds (list of str or None) – Sort algorithm for each PSRS stage.

Returns:

Sorted LiteFrame.

Return type:

LiteFrame

See also

drop_duplicates

Return LiteFrame with duplicate rows removed.

groupby

Group the LiteFrame by one or more columns.

Examples

>>> import maxframe.liteframe as mlf
>>> lf = mlf.LiteFrame({'a': [3, 1, 2], 'b': [6, 4, 5]})
>>> result = lf.sort('a')
>>> result.execute()
   a  b
1  1  4
2  2  5
0  3  6