Код: Выделить всё
x = all_dat['rcs']
y = all_dat['Mean_Range']
xnew = np.linspace(x.min(), x.max(), 200)
cubic_interploation_model = interp1d(x, y, kind = "cubic")
y_=cubic_interploation_model(xnew)
pl.plot(xnew , y_)
Код: Выделить всё
Traceback (most recent call last):
File "C:\Users\xxx\PycharmProjects\pythonProject1\seq_2_final.py", line 268, in
plot_alldata(df_all,p2)
File "C:\Users\xxx\PycharmProjects\pythonProject1\seq_2_final.py", line 201, in plot_alldata
cubic_interploation_model = interp1d(x, y, kind = "cubic")
File "C:\Users\xxx\PycharmProjects\pythonProject1\venv\lib\site-packages\scipy\interpolate\_interpolate.py", line 564, in __init__
self._spline = make_interp_spline(xx, yy, k=order,
File "C:\Users\xxx\PycharmProjects\pythonProject1\venv\lib\site-packages\scipy\interpolate\_bsplines.py", line 1295, in make_interp_spline
raise ValueError("Expect x to not have duplicates")
ValueError: Expect x to not have duplicates
Process finished with exit code 1
Подробнее здесь: https://stackoverflow.com/questions/725 ... with-scipy