I got the ValueError as given below.
ValueError: matrices are not aligned for copy error
It was traced to the following line (I did not write this code, I am trying to use it):
x1[:] = _dotproduct(x1, u)
The dot product is like numpy dot product, it works FINE, printing _dotproduct(x1, u)
give a valid answer. It is x1[:]
that is not working.
What does [:]
mean? I have never seen that.
Also how can I solve the error of alignment?
Edit:
I have now traced the error to x1[:]
, so instead of this can I do the following:
hh=len(x1)
x1[0:hh]=_dotproduct(x1, u)
?