def to_a
      [each_row.map(&:to_h), @index.to_a]
    end
Converts the DataFrame into an array of hashes where key is vector name
and value is the corresponding element. The 0th index of the array contains
the array of hashes while the 1th index contains the indexes of each row
of the dataframe. Each element in the index array corresponds to its row
in the array of hashes, which has the same index.