code: def group(X):
      """
      Returns unique numeric values for groups without sorting.
  
      Examples
      --------
      >>> X = np.array(['a','a','b','c','b','c'])
      >>> group(X)
      >>> g
      array([ 0.,  0.,  1.,  2.,  1.,  2.])
      """
      uniq_dict = {}
      group = np.zeros(len(X))
      for i in range(len(X)):
          if not X[i] in uniq_dict:
              uniq_dict.update({X[i]: len(uniq_dict)})
          group[i] = uniq_dict[X[i]]
      return group
  
imports: from functools import reduce
  import numpy
  from statsmodels.regression.linear_model import GLS
  from pandas import Panel
label_desc: Use image node_id 1 for calling a global function with example usage: group(X) and returns: group