parameters: (data, axis=None, use_missing=False)
docstring: Returns the rank (also known as order statistics) of each data point
      along the given axis.
  
      If some values are tied, their rank is averaged.
      If some values are masked, their rank is set to 0 if use_missing is False,
      or set to the average rank of the unmasked values if use_missing is True.
  
      Parameters
      ----------
      data : sequence
          Input data. The data is transformed to a masked array
      axis : {None,int}, optional
          Axis along which to perform the ranking.
          If None, the array is first flattened. An exception is raised if
          the axis is specified for arrays with a dimension larger than 2
      use_missing : bool, optional
          Whether the masked values have a rank of 0 (False) or equal to the
          average rank of the unmasked values (True).
docstring_summary: Returns the rank (also known as order statistics) of each data point
      along the given axis.
docstring_tokens: Returns the rank ( also known as order statistics ) of each data point along the given axis .
function: def rankdata(data, axis=None, use_missing=False):
      """Returns the rank (also known as order statistics) of each data point
      along the given axis.
  
      If some values are tied, their rank is averaged.
      If some values are masked, their rank is set to 0 if use_missing is False,
      or set to the average rank of the unmasked values if use_missing is True.
  
      Parameters
      ----------
      data : sequence
          Input data. The data is transformed to a masked array
      axis : {None,int}, optional
          Axis along which to perform the ranking.
          If None, the array is first flattened. An exception is raised if
          the axis is specified for arrays with a dimension larger than 2
      use_missing : bool, optional
          Whether the masked values have a rank of 0 (False) or equal to the
          average rank of the unmasked values (True).
  
      """
      def _rank1d(data, use_missing=False):
          n = data.count()
          rk = np.empty(data.size, dtype=float)
          idx = data.argsort()
          rk[idx[:n]] = np.arange(1,n+1)
  
          if use_missing:
              rk[idx[n:]] = (n+1)/2.
          else:
              rk[idx[n:]] = 0
  
          repeats = find_repeats(data.copy())
          for r in repeats[0]:
              condition = (data == r).filled(False)
              rk[condition] = rk[condition].mean()
          return rk
  
      data = ma.array(data, copy=False)
      if axis is None:
          if data.ndim > 1:
              return _rank1d(data.ravel(), use_missing).reshape(data.shape)
          else:
              return _rank1d(data, use_missing)
      else:
          return ma.apply_along_axis(_rank1d,axis,data,use_missing).view(ndarray)
function_tokens: def rankdata ( data , axis = None , use_missing = False ) : def _rank1d ( data , use_missing = False ) : n = data . count ( ) rk = np . empty ( data . size , dtype = float ) idx = data . argsort ( ) rk [ idx [ : n ] ] = np . arange ( 1 , n + 1 ) if use_missing : rk [ idx [ n : ] ] = ( n + 1 ) / 2. else : rk [ idx [ n : ] ] = 0 repeats = find_repeats ( data . copy ( ) ) for r in repeats [ 0 ] : condition = ( data == r ) . filled ( False ) rk [ condition ] = rk [ condition ] . mean ( ) return rk data = ma . array ( data , copy = False ) if axis is None : if data . ndim > 1 : return _rank1d ( data . ravel ( ) , use_missing ) . reshape ( data . shape ) else : return _rank1d ( data , use_missing ) else : return ma . apply_along_axis ( _rank1d , axis , data , use_missing ) . view ( ndarray )