ValueError: could not broadcast input array from shape (2,) into shape (0,)

Hi guys can you kindly help with the following error

ValueError: could not broadcast input array from shape (2,) into shape (0,)

<Figure size 1000x800 with 2 Axes>

Hi guys can you kindly help with the following error

ValueError: could not broadcast input array from shape (2,) into shape (0,)

Upvotes: 0

Views: 163

Answers (1)

Bibibou
Bibibou

Reputation: 21

Without the source code, it's hard to tell precisely what is the error but this is a typical error from a Python code where you are trying to do an operation on Numpy arrays that are not the same dimensions.

In the error message, the shape (2,) refers to an array with 2 elements along one dimension, and the shape (0,) refers to an array with 0 elements along that dimension. That is mathematically not possible and that's why you are getting this error message.

Upvotes: 0

Related Questions