79645147

Date: 2025-05-30 08:44:11
Score: 0.5
Natty:
Report link

When you call

popt_bad, _ = curve_fit

The _ means that you're completely disregarding the covariance matrices, which is the primary mechanism of assessing the success of the fit.

curve_fit always returns a value, even if it hasn't found a good value. You need a step which looks at this part of the return value and decides whether to trust the popt (at least check it isn't infinite).

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (0.5):
Posted by: Neil Butcher