What does the error "operands could not be broadcast together with shapes (415) (416)" mean? Caused by trying to filter large voltage changes

asked 2012-05-29 02:15:56 -0500

Peter B gravatar image

I've used the numpy module to measure voltages before and after a contingency and calculate the change. I can print the results so the calculation does take place.

However when I try to filter the results with an if statement so it only prints the results greater than 10% I get the error:

"operands could not be broadcast together with shapes (415) (416)"

Any idea on what the problem is?

edit retag flag offensive close merge delete

Comments

2

Hi Peter, can you post some small example code showing how the if statement is written?

Without having seen it, I think it will be to do with a mismatched shaped matrix multiplication or operation somewhere. Numpy requires that matrix operations have the correct sized matrix inputs.

JervisW gravatar imageJervisW ( 2012-05-29 11:04:44 -0500 )edit

I can't remember now where the code is that I was referring to! If it shows up again I will post.

Peter B gravatar imagePeter B ( 2012-08-01 18:22:38 -0500 )edit

No worries, you are allowed to answer your own question if you know the answer. The website gives you some "award", but I forget the name of it..."Self learner"?

JervisW gravatar imageJervisW ( 2012-08-03 01:02:58 -0500 )edit

If anyone else has a similar problem post your code - we'd love to help fix it.

JervisW gravatar imageJervisW ( 2012-10-23 00:54:07 -0500 )edit