Curve Fitting Python Code