I'm trying to preform a poly fit of roughly parabolic data. I run the following line:
fit = np.polynomial.polynomial.Polynomial.fit(x, y, 2)
fit
which produces the output:
↦ 300.76 − 2.38(-5.67+33.36) + 4.84(-5.67+33.36)2
I'm interested in a polynomial of the form: y(x) = a + bx + cx**2. I realize that in this case:
a = 300.76
b = -2.38
c = 4.84
However I can't access these numbers by array indices by doing something like fit[0]
or fit[1]
or fit[2]
. What am I missing here?