def to_h
      @vectors
        .each_with_index
        .map { |vec_name, idx| [vec_name, @data[idx]] }.to_h
    end
Converts DataFrame to a hash (explicit) with keys as vector names and values as
the corresponding vectors.