I tried this code of the two variables x1 and x2 .the shape of x1 is (1,3) while the shape of x2 is (3, ) . why is there a difference?

前端 未结 0 787
迷失自我
迷失自我 2020-12-05 17:20
 x1=[1,2,3]
 x2=[[1,2,3]]
 x1=np.array(x1)
 x2=np.array(x2)
 print(x1.shape)
 print(x2.shape)

the first output is (3, ) but the second output is (1,

相关标签:
回答
  • 消灭零回复
提交回复
热议问题