pyarrow.compute.SelectKOptions#

class pyarrow.compute.SelectKOptions(k, sort_keys)#

Bases: _SelectKOptions

Options for top/bottom k-selection.

Parameters:
kint

Number of leading values to select in sorted order (i.e. the largest values if sort order is “descending”, the smallest otherwise).

sort_keyssequence of (name, order) tuples

Names of field/column keys to sort the input on, along with the order each field/column is sorted in. Accepted values for order are “ascending”, “descending”. The field name can be a string column name or expression.

__init__(self, k, sort_keys)#

Methods

__init__(self, k, sort_keys)

deserialize(buf)

Deserialize options for a function.

serialize(self)

static deserialize(buf)#

Deserialize options for a function.

Parameters:
bufBuffer

The buffer containing the data to deserialize.

serialize(self)#