def set_index new_index_col, opts={}
      if new_index_col.respond_to?(:to_a)
        strategy = SetMultiIndexStrategy
        new_index_col = new_index_col.to_a
      else
        strategy = SetSingleIndexStrategy
      end

      uniq_size = strategy.uniq_size(self, new_index_col)
      raise ArgumentError, 'All elements in new index must be unique.' if
        @size != uniq_size

      self.index = strategy.new_index(self, new_index_col)
      strategy.delete_vector(self, new_index_col) unless opts[:keep]
      self
    end
def set_index new_index_col, opts={}
      if new_index_col.respond_to?(:to_a)
        strategy = SetMultiIndexStrategy
        new_index_col = new_index_col.to_a
      else
        strategy = SetSingleIndexStrategy
      end

      uniq_size = strategy.uniq_size(self, new_index_col)
      raise ArgumentError, 'All elements in new index must be unique.' if
        @size != uniq_size

      self.index = strategy.new_index(self, new_index_col)
      strategy.delete_vector(self, new_index_col) unless opts[:keep]
      self
    end
Set a particular column as the new DF