pyhon数组维度改变(7,)->(7,1)

2020-05-10  本文已影响0人  ChihyongChen

x.shape=(7,)

想要结果:x.shape=(7,1)

方法:1. np.reshape(x, (-1, 1))

           2. x.shape = (-1, 1)

上一篇 下一篇

猜你喜欢

热点阅读