list
2次元配列の転置
array1 = [[1,2,3],[3,4,5],[6,7,8]]
array2 = list(zip(*array1))
print(array2)
1次元配列の計算
array1 = [4,5,6]
array2 = [1,2,3]
#引き算
array_subtract = list(map(lambda x,y: x-y, array1, array2))
#[3,3,3]
#掛け算
array_multiple = list(map(lambda x,y: x*y, array1, array2))
#[4,10,18]
#割り算
array_div = list(map(lambda x,y: x/y, array1, array2))
2次元配列の足し算
array1 = [[1,2,3],[1,2,3]]
array2 = [[2,3,4],[2,3,4]]
array_add = list(map(lambda x,y: list(map(lambda a,b: a+b, x,y)), array1, array2))
#[[3, 5, 7], [3, 5, 7]]