sorting#
- cudf._lib.pylibcudf.sorting.is_sorted(Table tbl, list column_order, list null_precedence) bool #
Checks if the table is sorted.
- Parameters:
- tblTable
The table to check.
- column_orderList[ColumnOrder]
Whether each column is expected to be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls are expected before or after non-nulls.
- Returns:
- bool
Whether the table is sorted.
- cudf._lib.pylibcudf.sorting.rank(Column input_view, rank_method method, order column_order, null_policy null_handling, null_order null_precedence, bool percentage) Column #
Computes the rank of each element in the column.
- Parameters:
- input_viewColumn
The column to rank.
- methodrank_method
The method to use for ranking ties.
- column_orderorder
Whether the column should be sorted in ascending or descending order.
- null_handlingnull_policy
Whether or not nulls should be included in the ranking.
- null_precedencenull_order
Whether nulls should come before or after non-nulls.
- percentagebool
Whether to return the rank as a percentage.
- Returns:
- Column
The rank of each element in the column.
- cudf._lib.pylibcudf.sorting.segmented_sort_by_key(Table values, Table keys, Column segment_offsets, list column_order, list null_precedence) Table #
Sorts the table by key, within segments.
- Parameters:
- valuesTable
The table to sort.
- keysTable
The table to sort by.
- segment_offsetsColumn
The offsets of the segments.
- column_orderList[ColumnOrder]
Whether each column should be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls should come before or after non-nulls.
- Returns:
- Table
The sorted table.
- cudf._lib.pylibcudf.sorting.sort(Table source_table, list column_order, list null_precedence) Table #
Sorts the table.
- Parameters:
- source_tableTable
The table to sort.
- column_orderList[ColumnOrder]
Whether each column should be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls should come before or after non-nulls.
- Returns:
- Table
The sorted table.
- cudf._lib.pylibcudf.sorting.sort_by_key(Table values, Table keys, list column_order, list null_precedence) Table #
Sorts the table by key.
- Parameters:
- valuesTable
The table to sort.
- keysTable
The table to sort by.
- column_orderList[ColumnOrder]
Whether each column should be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls should come before or after non-nulls.
- Returns:
- Table
The sorted table.
- cudf._lib.pylibcudf.sorting.sorted_order(Table source_table, list column_order, list null_precedence) Column #
Computes the row indices required to sort the table.
- Parameters:
- source_tableTable
The table to sort.
- column_orderList[ColumnOrder]
Whether each column should be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls should come before or after non-nulls.
- Returns:
- Column
The row indices required to sort the table.
- cudf._lib.pylibcudf.sorting.stable_segmented_sort_by_key(Table values, Table keys, Column segment_offsets, list column_order, list null_precedence) Table #
Sorts the table by key preserving order of equal elements, within segments.
- Parameters:
- valuesTable
The table to sort.
- keysTable
The table to sort by.
- segment_offsetsColumn
The offsets of the segments.
- column_orderList[ColumnOrder]
Whether each column should be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls should come before or after non-nulls.
- Returns:
- Table
The sorted table.
- cudf._lib.pylibcudf.sorting.stable_sort(Table source_table, list column_order, list null_precedence) Table #
Sorts the table preserving order of equal elements.
- Parameters:
- source_tableTable
The table to sort.
- column_orderList[ColumnOrder]
Whether each column should be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls should come before or after non-nulls.
- Returns:
- Table
The sorted table.
- cudf._lib.pylibcudf.sorting.stable_sort_by_key(Table values, Table keys, list column_order, list null_precedence) Table #
Sorts the table by key preserving order of equal elements.
- Parameters:
- valuesTable
The table to sort.
- keysTable
The table to sort by.
- column_orderList[ColumnOrder]
Whether each column should be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls should come before or after non-nulls.
- Returns:
- Table
The sorted table.
- cudf._lib.pylibcudf.sorting.stable_sorted_order(Table source_table, list column_order, list null_precedence) Column #
Computes the row indices required to sort the table, preserving order of equal elements.
- Parameters:
- source_tableTable
The table to sort.
- column_orderList[ColumnOrder]
Whether each column should be sorted in ascending or descending order.
- null_precedenceList[NullOrder]
Whether nulls should come before or after non-nulls.
- Returns:
- Column
The row indices required to sort the table.