def subset *indexes
      positions = pos(*indexes)
      new_index = positions.map { |pos| index_from_pos pos }

      Daru::CategoricalIndex.new new_index.flatten
    end
def subset *indexes
      positions = pos(*indexes)
      new_index = positions.map { |pos| index_from_pos pos }

      Daru::CategoricalIndex.new new_index.flatten
    end
Return subset given categories or positions
 @param indexes [Array<object>] categories or positions
 @return [Daru::CategoricalIndex] subset of the self containing the
   mentioned categories or positions
 @example
   idx = Daru::CategoricalIndex.new [:a, :b, :a, :b, :c]
   idx.subset :a, :b
   # => #<Daru::CategoricalIndex(4): {a, b, a, b}>