Connect your moderator Slack workspace to receive post notifications:
Sign in with Slack

Problem with my import and hstack in my code

I have a problem with this import:

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,)

What can I do with this?

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.

Page 1 of 1

Add comment

Post as Anonymous Dont send out notification