How to unzip an Array in Ruby like this examples in Python:
>>> x = [1, 2, 3] >>> y = [4, 5, 6] >>> zipped = zip(x, y) >>>
Use transpose:
> zipped = x.zip(y) => [[1, 4], [2, 5], [3, 6]] > x2, y2 = zipped.transpose > x2 => [1, 2, 3] > y2 => [4, 5, 6]