📜  展平二维数组 python 代码示例

📅  最后修改于: 2022-03-11 14:46:16.377000             🧑  作者: Mango

代码示例1
arr_2d = [[1, 2, 3], [4, 5, 6]]
arr_1d = [el for arr in arr_2d for el in arr]
print(arr_1d) # [1, 2, 3, 4, 5, 6]