[Numpy-discussion] How-to: Uniform vector scale
Wed Sep 5 14:05:15 CDT 2007
I have a scalar value S. I want to perform the following math on vectors A
and B (both of type array):
A + B * S
By order of operations, B * S should be done first. This is a vector
multiplied by a real number and should be valid. However, the interpreter
"ValueError: shape mismatch: objects cannot be broadcast to a single
I am not sure how I am supposed to multiply a vector with a scalar value.
array([5,2]) * 2 = [10,4]
The above should happen. However, I get the error message instead. Any
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion