import numpy as np
mulArrays = [[1,2,3],[4,5,6],[7,8,9]]
print(list(np.array(mulArrays).flatten()))
import numpy as np
mulArrays = [[1,2,3],[4,5,6],[7,8,9]]
print(list(np.concatenate(array.reshape((-1,1),order="F"))))
mulArrays = [[1,2,3],[4,5,6],[7,8,9]]
print(sum(mulArrays,[])) #[1, 2, 3, 4, 5, 6, 7, 8, 9]
mulArrays = [[1,2,3],[4,5,6],[7,8,9]]
print([i for arr in mulArrays for i in arr]) #[1, 2, 3, 4, 5, 6, 7, 8, 9]
import operator
from functools import reduce
mulArrays = [[1,2,3],[4,5,6],[7,8,9]]
print(reduce(operator.add, mulArrays))
from itertools import chain
mulArrays = [[1,2,3],[4,5,6],[7,8,9]]
print(list(chain.from_iterable(mulArrays))) #[1, 2, 3, 4, 5, 6, 7, 8, 9]
参考博文:
https://leejason.blog.csdn.net/article/details/106928360