If the problem persists, try using a checkpoints file that has been updated with the newest code.

The output will be like this:

The Code is given below:

import numpy as np
Import pandas as pd
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
def fun(x, a, b, n):
return a * x ** n / (x ** n + b)

df = pd.read_csv('data.txt.txt', sep='\t')
y = df['y'].astype(float)
x = df['X'].astype(float)
popt, pcov = curve_fit(f, x, y, p0=[1800., 20., 1.])
plt.scatter(x, y)
plt.plot(x, f(x, *popt), 'r-')
plt.show()