ok I just stumbled upon arr.transpose
arr = [['a', '1'], ['b','2'], ['c', '3']].transpose
first = arr[0]
second = arr[1]
compared to the answers above arr.zip, arr.mapand foreachwhich is more efficient? Or is this the most elegant solution?
OR (Thanks, comment by Jörg W Mittag - see Comment below) first, second = arr.transpose
source
share