def _gt_median(x: list[int | float]) -> int | float:
    """
    Calculate the median of a list of values.
    """
    x.sort()
    n = len(x)
    if n % 2 == 0:
        return (x[n // 2 - 1] + x[n // 2]) / 2
    else:
        return x[n // 2]

    Calculate the median of a list of values.
    
great_tables/_utils_nanoplots.py