The **numpy.expm1**** function **in NumPy computes the exponential minus one (

) for all elements of a given input array.**exp(x) - 1**

numpy.expm1(x, out=None, where=True, *)

Syntax for the numpy.expm1() function

The `numpy.expm1()`

function takes the following parameter values:

: This is the array-like object that contains the input values. It is required.**x**

: This is the location where the result obtained is stored. It is optional.**out**

: This is the condition over which the broadcast is done over the input. It is optional.**where**

: This represents keyword-only arguments.****kwargs**

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))

- Line 1: We import the
`numpy`

module. - Lines 4–6: We implement the
`numpy.expm1()`

function on different input values. Then, we print each result to the console.

TRENDING TOPICS