code: def rankdata(x):
      """rankdata, equivalent to scipy.stats.rankdata
  
      just a different implementation, I have not yet compared speed
  
      """
      uni, intlab = np.unique(x[:, 0], return_inverse=True)
      groupnobs = np.bincount(intlab)
      groupxsum = np.bincount(intlab, weights=X[:, 0])
      groupxmean = groupxsum * 1.0 / groupnobs
  
      rankraw = x[:, 0].argsort().argsort()
      groupranksum = np.bincount(intlab, weights=rankraw)
      # start at 1 for stats.rankdata :
      grouprankmean = groupranksum * 1.0 / groupnobs + 1
      return grouprankmean[intlab]
  
imports: from collections import namedtuple
  from statsmodels.compat.python import lzip, lrange
  import copy
  import math
  import numpy
  from numpy.testing import assert_almost_equal, assert_equal
  from scipy import stats, interpolate
  from statsmodels.iolib.table import SimpleTable
  from statsmodels.stats.multitest import multipletests, _ecdf, fdrcorrection, fdrcorrection_twostage
  from statsmodels.graphics import utils
  from statsmodels.tools.sm_exceptions import ValueWarning
label_desc: Use image node_id 14 for calling a global function with example usage: rankdata(x) and returns: grouprankmean