How to Solve NameError: name 'curve_fit' is not defined -- scipy
Solution: Import the 'curve_fit' module
To Solve the error, add the following line to the top of your code.
from scipy.optimize import curve_fit
For more information:
Python scipy curve_fit