def rank(values, axis=<NUM_LIT:0>, method='<STR_LIT>', na_option='<STR_LIT>',<EOL>ascending=True, pct=False):
if values.ndim == <NUM_LIT:1>:<EOL><INDENT>f, values = _get_data_algo(values, _rank1d_functions)<EOL>ranks = f(values, ties_method=method, ascending=ascending,<EOL>na_option=na_option, pct=pct)<EOL><DEDENT>elif values.ndim == <NUM_LIT:2>:<EOL><INDENT>f, values = _get_data_algo(values, _rank2d_functions)<EOL>ranks = f(values, axis=axis, ties_method=method,<EOL>ascending=ascending, na_option=na_option, pct=pct)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>return ranks<EOL>
Rank the values along a given axis.

Parameters
----------
values : array-like
    Array whose values will be ranked. The number of dimensions in this
    array must not exceed 2.
axis : int, default 0
    Axis over which to perform rankings.
method : {'average', 'min', 'max', 'first', 'dense'}, default 'average'
    The method by which tiebreaks are broken during the ranking.
na_option : {'keep', 'top'}, default 'keep'
    The method by which NaNs are placed in the ranking.
    - ``keep``: rank each NaN value with a NaN ranking
    - ``top``: replace each NaN with either +/- inf so that they
               there are ranked at the top
ascending : boolean, default True
    Whether or not the elements should be ranked in ascending order.
pct : boolean, default False
    Whether or not to the display the returned rankings in integer form
    (e.g. 1, 2, 3) or in percentile form (e.g. 0.333..., 0.666..., 1).