NumPy - expm1() function
The NumPy expm1() function is used to calculate e raised to the power of given value minus 1, i.e., ex-1. Please note that e is the base of the natural system of logarithms, and its value is approximately 2.718282.
Returns the exponential minus 1 of each element of a.
In the below example, numpy expm1() function is used to calculate the exponential minus 1 of each element present in array Arr.
import numpy as np Arr = np.array([0, 1, 2, 3]) print("The exponential minus 1 of values:") print(np.expm1(Arr))
The output of the above code will be:
The exponential minus 1 of values: [ 0. 1.71828183 6.3890561 19.08553692]
❮ NumPy - Functions