import numpy as np a = np.array([[1,2,3],[4,5,6]]) a.shape = (3,2) print (a). 输出结果为: [[1 2] [3 4] [5 6]]. NumPy 也提供了reshape 函数来调整数组大小。
確定! 回上一頁