def rank(self, axis=<NUM_LIT:0>, method='<STR_LIT>', numeric_only=None,<EOL>na_option='<STR_LIT>', ascending=True, pct=False):
axis = self._get_axis_number(axis)<EOL>if self.ndim > <NUM_LIT:2>:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise NotImplementedError(msg)<EOL><DEDENT>if na_option not in {'<STR_LIT>', '<STR_LIT>', '<STR_LIT>'}:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg)<EOL><DEDENT>def ranker(data):<EOL><INDENT>ranks = algos.rank(data.values, axis=axis, method=method,<EOL>ascending=ascending, na_option=na_option,<EOL>pct=pct)<EOL>ranks = self._constructor(ranks, **data._construct_axes_dict())<EOL>return ranks.__finalize__(self)<EOL><DEDENT>if numeric_only is None:<EOL><INDENT>try:<EOL><INDENT>return ranker(self)<EOL><DEDENT>except TypeError:<EOL><INDENT>numeric_only = True<EOL><DEDENT><DEDENT>if numeric_only:<EOL><INDENT>data = self._get_numeric_data()<EOL><DEDENT>else:<EOL><INDENT>data = self<EOL><DEDENT>return ranker(data)<EOL>
Compute numerical data ranks (1 through n) along axis. Equal values are
assigned a rank that is the average of the ranks of those values.

Parameters
----------
axis : {0 or 'index', 1 or 'columns'}, default 0
    index to direct ranking
method : {'average', 'min', 'max', 'first', 'dense'}
    * average: average rank of group
    * min: lowest rank in group
    * max: highest rank in group
    * first: ranks assigned in order they appear in the array
    * dense: like 'min', but rank always increases by 1 between groups
numeric_only : boolean, default None
    Include only float, int, boolean data. Valid only for DataFrame or
    Panel objects
na_option : {'keep', 'top', 'bottom'}
    * keep: leave NA values where they are
    * top: smallest rank if ascending
    * bottom: smallest rank if descending
ascending : boolean, default True
    False for ranks by high (1) to low (N)
pct : boolean, default False
    Computes percentage rank of data

Returns
-------
ranks : same type as caller