code: def set_group(self, group):
          
          self.group = group
          if self.handle is not None and group is not None:
              group = list_to_1d_numpy(group, np.int32, name='group')
              self.set_field('group', group)
          return self
docs: Set group size of Dataset (used for ranking).
  
          Parameters
          ----------
          group : list, numpy 1-D array, pandas Series or None
              Group size of each group.
  
          Returns
          -------
          self : Dataset
              Dataset with set group.