data =3D [[:time, :pressure],[0,2.3],[1,4.1],[2,7.56],...]
axes =3D data.shift   #shift the axes labels out from the data set
new_data =3D data.collect{|point| {axes[0] =3D> point[0], axes[1] =3D> poin=
t
[1]}}  #pair the axes with the data by iterating and collecting the
results

Tim


On Sep 26, 11:10=A0pm, Jason Lillywhite <jason.lillywh... / gmail.com>
wrote:
> I have this array:
> data =3D [[:time, :pressure],[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 =3D
> [{:time=3D>0,:pressure=3D>2.3},{:time=3D>1,:pressure=3D>4.1},{:time=3D>2,=
:pressure=3D>7 .56}]
>
> Is there a straight forward way to set this up? I'm happy with hints.
> Thank you!
> --
> Posted viahttp://www.ruby-forum.com/.