17.6 C
London
Monday, July 21, 2025
HomePythonDescriptive Statistics in PythonHow to Find the Antilog of Values in Python

How to Find the Antilog of Values in Python

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

The antilog of a number is the inverse of the log of a number.

So, if you calculate the log of a number you can then use the antilog to get back the original number.

For example, suppose we start with the number 7. If we take the log (base 10) of 7 then we would get .845:

log10(7) = .845

The antilog (base 10) of the value 0.845 can be found by taking 10 raised to the power of 0.845:

10.845 = 7

The antilog allowed us to get back the original number.

The following table shows how to calculate the antilog of values in Python according to their base:

Base Number Log Antilog
e x np.log(x) np.exp(x)
10 x np.log10(x) 10 ** x

The following examples show how to calculate the antilog of values in Python using different values for the base.

Example 1: Calculating the Antilog of Base 10

Suppose we take the log (base 10) of the value 7:

import numpy as np

#define original value
original = 7

#take log (base 10) of original value
log_original = np.log10(original)

#display log (base 10) of original value
log_original

0.845098

In order to get back the original value of 7, we can take the antilog by raising 10 to the power of 0.845098:

#take the antilog
10 ** log_original

7.0

By taking the antilog, we were able to obtain the original value of 7.

Example 2: Calculating the Antilog of a Natural Log

Suppose we take the natural log of the value 7:

#define original value
original = 7

#take natural log of original value
log_original = np.log(original)

#display natural log of original value
log_original

[1] 1.94591

In order to get back the original value of 7, we can take the antilog by raising e to the power of 1.94591:

#take the antilog
np.exp(log_original)

7.0

By taking the antilog, we were able to obtain the original value of 7.

Additional Resources

How to Create a Log-Log Plot in Python
How to Perform a Box-Cox Transformation in Python

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories