📜  将 2d 列表转换为 1d python 代码示例

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

代码示例2
# Create a 2D Numpy Array.
arr = np. array([[0, 1, 2],
[3, 4, 5],
[6, 7, 8]])
# convert 2D array to a 1D array of size 9.
flat_arr = np. reshape(arr, 9)