Q:

Represent spreadsheet with array of arrays or each row as hash of arrays

This is a concept question regarding data structures in ruby. I would like to iterate through rows of a spreadsheet. There are gems to do this, but I want to understand the difference between allocating a row as a hash of arrays (where the first column is the key and the rest of them the value as array) and just having a row as an array. Does it matter?

A:

It really depends on what you want to do with the result.
Representing a spreadsheet as an array of arrays means determining the meaning of each cell positionally, which is more complex than using a hash. But if you don't care about the meaning and just wanted to write the data to a csv for example, then an array of arrays would be suitable.
So think about what you actually want to do with the data in the future.

