Hướng dẫn inverse log python

y=np.log10(train_set["SalePrice"])

how do i find inverse of this ?? I want it to return back to the original value and not the scaled value

hoefling

50.9k10 gold badges129 silver badges167 bronze badges

asked Aug 3, 2018 at 9:21

2

Hope the above answers were helpful, in case you or anyone want the inverse for log10 (base 10) and log (natural)

# Logarithm and back to normal value
y = np.log10(train_set["SalePrice"])
train_set["SalePrice"] = 10 ** y

# Natural log and back to normal value using built-in numpy exp() function
y = np.log(train_set["SalePrice"])
train_set["SalePrice"] = np.exp(y)

answered Mar 23, 2020 at 13:44

Hướng dẫn inverse log python

If you want to obtain the original value then you can do:

z = 10**y

answered Aug 3, 2018 at 9:25

Jacques UngJacques Ung

1492 silver badges6 bronze badges

y = np.log10(train_set["SalePrice"])

return back to the original value all of array elements

Z = np.array(10**y)

answered Jun 1, 2020 at 14:36

Not the answer you're looking for? Browse other questions tagged python inverse or ask your own question.