I use numpy.polyfit to fit a 2nd order polynomial to a dataset
fit1, fit_err1, _, _, _ = np.polyfit(xint[:index_max], yint[:index_max], 2, full=True)
For some few examples of my data, the fit_err1 variable fit_err1 empty, although the fit was successful, i.e. fit1 not empty!
Does anyone know what empty residual funds are in this context? Thanks!
EDIT: one example dataset:
x = [-488., -478., -473.] y = [ 0.02080881, 0.03233648, 0.03584448] fit1, fit_err1, _, _, _ = np.polyfit(x, y, 2, full=True)
result:
fit1 = [ -3.00778818e-05 -2.79024663e-02 -6.43272769e+00] fit_err1 = []
I know that fitting a 2nd order polynomial to a set of three points is not very useful, but then I still expect the function to either raise a warning, or (since it actually determined the match) return the actual residuals, or both (like "here leftovers, but your conditions are poor! ").