Check out my course on UDEMY: learn the skills you need for coding in STEM:
https://www.udemy.com/course/python-stem-essentials/
In this video I show how to use the curvefit function in the scipy.optimize library. I also look at practical examples from physics.
Tutorial Playlist:
https://www.youtube.com/playlist?list=PLkdGijFCNuVnGxo-1fSNcdHh5gZc17oRM
Code:
https://github.com/lukepolson/youtube_channel/blob/main/Python%20Tutorial%20Series/curvefit1.ipynb
Discord:
https://discord.gg/hTBzC9RNZX