def METHOD_NAME(
        array: NDArrayAny,
        method: tp.Union[str, RankMethod],
        ascending: bool = True,
        start: int = 0,
        axis: int = 0,
        ) -> NDArrayAny:
    '''
    Args:
        axis: if 0, columns are ranked, if 1, rows are ranked
    '''
    # scipy uses np.apply_along_axis, but that handles many more cases than needed
    dtype: DtypeAny
    if method == RankMethod.MEAN:
        dtype = DTYPE_FLOAT_DEFAULT
    else:
        dtype = DTYPE_INT_DEFAULT
    shape = array.shape
    post = np.empty(shape, dtype=dtype)
    if axis == 0: # apply by column
        for i in range(shape[1]):
            post[:, i] = rank_1d(array[:, i], method, ascending, start)
    elif axis == 1: # apply by row
        for i in range(shape[0]):
            post[i] = rank_1d(array[i], method, ascending, start)
    post.flags.writeable = False
    return post