Skip to content

Instantly share code, notes, and snippets.

@oki
Created December 22, 2008 09:59
Show Gist options
  • Select an option

  • Save oki/38944 to your computer and use it in GitHub Desktop.

Select an option

Save oki/38944 to your computer and use it in GitHub Desktop.
>> a = [1,2,3]
=> [1, 2, 3]
>> b = %w(a b c)
=> ["a", "b", "c"]
>> x = [a,b]
=> [[1, 2, 3], ["a", "b", "c"]]
>> x.transpose
=> [[1, "a"], [2, "b"], [3, "c"]]
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment