transpose a multi-demensional array : Multidimensional Arrays « Array « Ruby






transpose a multi-demensional array


d2 = [ ["January", 2007], ["February", 2007], ["March", 2007] ]
d2.transpose # => => [["January", "February", "March"], [2007, 2007, 2007]]

p d2

 








Related examples in the same category

1.What is a multi-dimensional Arrays
2.Combine three arrays to create multi-dimensional array
3.flatten a multi-demensional array
4.Size and elements in a two-dimensional array
5.Convert a two-dimensional array to a hash
6.Three dimensional array