Curve fitting in Python with curve_fit