Numpy reshape 1d to 2d array with 1 column

后端 未结 7 573
一生所求
一生所求 2020-12-08 15:08

In numpy the dimensions of the resulting array vary at run time. There is often confusion between a 1d array and a 2d array with 1 column. In one case I can ite

相关标签:
7条回答
  • 2020-12-08 15:36
    y = np.array(12)
    y = y.reshape(-1,1)
    print(y.shape)
    
    O/P:- (1, 1)
    
    0 讨论(0)
提交回复
热议问题