I am concatenating a 1D numpy array to a 2D numpy array, but the code gives the following error:
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (2, 3) + inhomogeneous part.
How can I fix this error?
Here is the code:
>>> import numpy as np
>>> a=np.array([[1,2,3],[4,5,6],[7,8,9]])
>>> b=np.array([10,11,12])
>>> np.concatenate([[a,b]])