I\'m trying to get a best fit line to some data my script generates. This is what I have:
import numpy as np
import scipy as sp
.
.
.
def func(x, a, b, c):
ValueError: operands could not be broadcast together with shapes (0) (26)
implies that first of your arrays is of length 0. From your post it is most obviously the case and the error provoking ValueError.
I had the same problem until I realized I had been using lists instead of Numpy arrays. Converting to arrays fixed it for me.