sorting#

pylibcudf.sorting.is_sorted(Table tbl, list column_order, list null_precedence) bool#

Checks if the table is sorted.

For details, see 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.

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.

For details, see rank().

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.

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.

For details, see segmented_sort_by_key().

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.

pylibcudf.sorting.sort(Table source_table, list column_order, list null_precedence) Table#

Sorts the table.

For details, see sort().

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.

pylibcudf.sorting.sort_by_key(Table values, Table keys, list column_order, list null_precedence) Table#

Sorts the table by key.

For details, see sort_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.

pylibcudf.sorting.sorted_order(Table source_table, list column_order, list null_precedence) Column#

Computes the row indices required to sort the table.

For details, see sorted_order().

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.

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.

For details, see stable_segmented_sort_by_key().

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.

pylibcudf.sorting.stable_sort(Table source_table, list column_order, list null_precedence) Table#

Sorts the table preserving order of equal elements.

For details, see stable_sort().

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.

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.

For details, see stable_sort_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.

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.

For details, see stable_sorted_order().

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.