在Python 中,可以使用numpy 库中的flatten() 或ravel() 函数将多维数组转化为一维数组。 使用numpy.flatten():. import numpy as np a = np.array([[1, 2], [3, 4], ...
確定! 回上一頁