import numpy as np
...
np.hstack([a, b]) + v # does not work
which gives the following error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-35-ee6037013b2b> in <module>()
----> 1 np.hstack([a, b]) + v # does not work
ValueError: operands could not be broadcast together with shapes (2,4) (2,)
tup: sequence of ndarrays
The arrays must have the same shape along all but the second axis, except 1-D arrays which can be any length.
I think that b has to be 2-D as well.
Problem with my import and hstack in my code
I have a problem with this import:
which gives the following error:
What can I do with this?
1
tup: sequence of ndarrays
The arrays must have the same shape along all but the second axis, except 1-D arrays which can be any length.
I think that b has to be 2-D as well.
1
Add comment