J
Jason Lillywhite
I have this array:
data = [[:time, ressure],[0,2.3],[1,4.1],[2,7.56],...]
All the arrays in data could have an arbitrary number of items in it and
the total number of arrays in data is arbitrary but all arrays will be
the same size and the first array will always be the "header" array.
I need to convert data to an array that looks like this:
new_data =
[{:time=>0,ressure=>2.3},{:time=>1,ressure=>4.1},{:time=>2,ressure=>7.56}]
Is there a straight forward way to set this up? I'm happy with hints.
Thank you!
data = [[:time, ressure],[0,2.3],[1,4.1],[2,7.56],...]
All the arrays in data could have an arbitrary number of items in it and
the total number of arrays in data is arbitrary but all arrays will be
the same size and the first array will always be the "header" array.
I need to convert data to an array that looks like this:
new_data =
[{:time=>0,ressure=>2.3},{:time=>1,ressure=>4.1},{:time=>2,ressure=>7.56}]
Is there a straight forward way to set this up? I'm happy with hints.
Thank you!