How to do exponential and logarithmic curve fitting in Python? I found only polynomial fitting
For fitting y = A + B log x, just fit y against (log x). >>> x = numpy.array([1, 7, 20, 50, 79]) >>> y = numpy.array([10, 19, 30, 35, 51]) >>> numpy.polyfit(numpy.log(x), y, 1) array([ 8.46295607, 6.61867463]) # y ≈ 8.46 log(x) + 6.62 For fitting y = AeBx, take the logarithm of both … Read more