code: def set_labels(self, labels, axis='rows'):
          '''
          Set the row/col labels.
          Note that this method doesn't check that enough labels were set for all the assigned positions.
          '''
          if axis.lower() in ('rows', 'row', 'r', 0):
              assigned_pos = set(v[0] for v in self._positions.itervalues())
              not_assigned = set(labels) - assigned_pos
              if len(not_assigned) > 0:
                  msg = 'New labels must contain all assigned positions'
                  raise ValueError(msg)
              self.row_labels = labels
          elif axis.lower() in ('cols', 'col', 'c', 1):
              self.col_labels = labels
          else:
              raise TypeError('Unsupported axis value %s' % axisf set_labels(self, labels, axis='rows'):
          '''
          Set the row/col labels.
          Note that this method doesn't check that enough labels were set for all the assigned positions.
          '''
          if axis.lower() in ('rows', 'row', 'r', 0):
              assigned_pos = set(v[0] for v in self._positions.itervalues())
              not_assigned = set(labels) - assigned_pos
              if len(not_assigned) > 0:
                  msg = 'New labels must contain all assigned positions'
                  raise ValueError(msg)
              self.row_labels = labels
          elif axis.lower() in ('cols', 'col', 'c', 1):
              self.col_labels = labels
          else:
              raise TypeError('Unsupported axis value %s' % axis)
docs: Set the row/col labels.
          Note that this method doesn't check that enough labels were set for all the assigned positions.