RRankTrell
Product

Product features · Average ranks for ties

01

RankTrell helps inspect tied observations without rearranging the source data, checking that each original position receives the mean rank of its tie group.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Average ranks for ties

● ● ●RankTrell●
A concrete starting point · Average ranks for ties ×
from math import isfinite

def average_ranks(values):
    if type(values) not in (list, tuple) or len(values) > 1000:
        raise ValueError("values.container")
    values = tuple(values)
    if len(values) > 1000 or any(
        type(v) not in (int, float) or
        (type(v) is float and not isfinite(v)) for v in values
    ):
        raise ValueError("values.invalid")
    order = sorted(range(len(values)), key=values.__getitem__)
    result = [0.0] * len(values)
    first = 0
    while first < len(order):
        end = first + 1
        while end < len(order) and values[order[end]] == values[order[first]]:
            end += 1
        rank = (first + 1 + end) / 2
        for i in order[first:end]:
            result[i] = rank
        first = end
    return result
✳Assign one-based average ranks to at most 1000 finite numeric values while preserving their input positions.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗