Reputation: 37
Python numpy library log method returning wrong value so please help me.
import numpy as np
print('Log :',np.log(0.25))
numpy log method returns -1.38629436112
Excel log function =LOG(0.25)
returns -0.602059991327962
Then I Calculated manually using calculator it returns -0.602059991327962
.
Upvotes: 0
Views: 2137
Reputation: 5996
Because the log
function is in base e
while your calculator and excel are base 10
by default. Use np.log10(0.25)
and you'll get the value you want.
Upvotes: 5