The numpy.expm1 function in NumPy computes the exponential minus one (exp(x) - 1) for all elements of a given input array.
numpy.expm1(x, out=None, where=True, *)
The numpy.expm1() function takes the following parameter values:
x: This is the array-like object that contains the input values. It is required.out: This is the location where the result obtained is stored. It is optional.where: This is the condition over which the broadcast is done over the input. It is optional.**kwargs: This represents keyword-only arguments.The numpy.expm1 function returns an element-wise exponential minus one of the input array.
import numpy as np# Implementing the numpy.expm1() functionprint(np.expm1(5))print(np.expm1(0.5))print(np.expm1(1e-10))
numpy module.numpy.expm1() function on different input values. Then, we print each result to the console.