Мой код:
[from scipy.optimize import curve_fit from numpy import array, sinc,where from sympy import * values_y = array([0,0,16,9,4, 1, 0, 1, 4 ,9 ,16,0,0]) values_x = array(range(len(values_y))) def func1(y, a,b,c3,c2 ): return where((y>=c3) & (y<=c2),a*(y-b)**2, 0) arg=curve_fit(func1, values_x, values_y, p0= (1,4,0,7)) print (arg) C:\Users\9: OptimizeWarning: Covariance of the parameters could not be estimated category=OptimizeWarning) (array([0.15560438, 5.99930899, 0. , 7. ]), array([[inf, inf, inf, inf], [inf, inf, inf, inf], [inf, inf, inf, inf], [inf, inf, inf, inf]])) Process finished with exit code 0]