| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/../generated/../generated/pyarrow.compute.rank.html | [Back] [Original] |
Section Navigation
Compute ordinal ranks of an array (1-based).
This function computes a rank of the input array. By default, null values are considered greater than any other value and are therefore sorted at the end of the input. For floating-point types, NaNs are considered greater than any other non-null value, but smaller than null values. The default tiebreaker is to assign ranks in order of when ties appear in the input.
The handling of nulls, NaNs and tiebreakers can be changed in RankOptions.
Argument to compute function.
name, order, null_placement) tuples or str, default ascendingNames 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. Accepted values for null_placement are at_start, at_end. The field name can be a string column name or expression. Alternatively, one can simply pass ascending or descending as a string if the input is array-like.
str | None, default NoneWhere nulls in input should be sorted. Accepted values are at_start, at_end. Overwrites the null_placement inside sort_keys
str, default firstConfigure how ties between equal values are handled. Accepted values are:
min: Ties get the smallest possible rank in sorted order.
max: Ties get the largest possible rank in sorted order.
input. This ensures the ranks are a stable permutation of the input.
number of distinct values in the input.
pyarrow.compute.RankOptions, optionalAlternative way of passing options.
pyarrow.MemoryPool, optionalIf not passed, will allocate memory from the default memory pool.
Copyright 2016-2026 Apache Software Foundation.
Apache Arrow, Arrow, Apache, the Apache logo, and the Apache Arrow project logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
Created using Sphinx 9.1.0.
Built with the PyData Sphinx Theme 0.20.0.
| Web Proxy Viewer | New URL | Original Page |