Fix Python – How do you do natural logs (e.g. “ln()”) with numpy in Python?

Question

Asked By – user1220022

Using numpy, how can I do the following:

ln(x)

Is it equivalent to:

np.log(x)

I apologise for such a seemingly trivial question, but my understanding of the difference between log and ln is that ln is logspace e?

Now we will see solution for issue: How do you do natural logs (e.g. “ln()”) with numpy in Python?


Answer

np.log is ln, whereas np.log10 is your standard base 10 log.

This question is answered By – JoshAdel

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0