【Python】 リストの入れ替え
zip関数便利だね。
特に多次元なリストの入れ替えとか
特に多次元なリストの入れ替えとか
data = [ 1, 2, 3],
[ 4, 5, 6],
[ 7, 8, 9],
[10, 11, 12],
[13, 14, 15]
]
list(map(list, zip(*data)))こっちも良い
import itertools
list(map(list, list(itertools.zip_longest(*data))))