Sounds like you’re interested in curve fitting. I would recommend intro to statistical learning for a good intro to related topics.

Free download

https://www.statlearning.com/

Oh wow! I had no idea they came out with a Python version!