SyntaxFix
Write A Post
Hire A Developer
Questions
You can also cast (n,) to (n,1) by enclosing within brackets [ ].
e.g. Instead of np.append(b,a,axis=0) use np.append(b,[a],axis=0)
np.append(b,a,axis=0)
np.append(b,[a],axis=0)
a=[1,2] b=[[5,6],[7,8]] np.append(b,[a],axis=0)
returns
array([[5, 6], [7, 8], [1, 2]])