import numpy as np
x = np.array([1,2,3])
print(f'x.shape={x.shape}')
print(f'x.reshape((1,-1))={x.reshape((1,-1))}')
print(f'x.reshape(3,)={x.reshape(3,)}')
print(f'x.reshape(3,1)=\n{x.reshape(3,1)}')
print(f'x[:,np.newaxis]=\n{x[:,np.newaxis]}')
【python】reshape的使用
最新推荐文章于 2024-05-07 09:56:58 发布