numpy-轉換維度

x=np.array([[[1],[2]],[[3],[4]]]) x.shape Out[109]: (2, 2, 1) x.reshape(2,2) Out[110]: array([[1, 2], [3, 4]]) x Out[111]: array([[[1], [2]], [[3], [4]]]) y=x.reshape(2,2) y Out[113]: array([[1, 2], [3, 4]]) y.reshape(2,2,1) Out[114]: array([[[1], [2]], [[3], [4]]])
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章