What is the arcsinh function in numpy?
In numpy, a library of the high-level programming language Python, we can use the arcsinh function to calculate the inverse hyperbolic sin of a set of values.
The numpy library must be imported to use the arcsinh function:
import numpy as np
Syntax
np.arcsinh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj])= <ufunc 'arcsinh'>
A universal function (
ufunc) is a function that operates on ndarrays in an element-by-element fashion. Thearcsinhmethod is a universal function.
Arguments
The arcsinh function only accepts the following arguments:
x: An array-like structure on the contents of which thearcsinhfunction will be applied.out(optional): The function’s output is stored at this location.where(optional): If setTrue, a universal function is calculated at this position.casting(optional): This enables the user to decide how the data will be cast. If set as same_kind, safe casting will take place.order(optional): This determines the memory layout of the output. For example, if set as K, the function reads data in the order they are written in memory.dtype(optional): This is the data type of the array.subok(optional): To pass subclasses,subokmust be set asTrue.
Return value
The arcsinh function returns an angle of type float whose imaginary part lies in [-pi/2,pi/2].
If a number can not be represented as a real number or infinity, it returns nan, and the invalid floating point error flag is set.
If x is a scalar, the return value is also a scalar.
For real input, the arcsinh function returns real input.
The arcsinh function has branch cuts [1j, infj] and [-1j, -infj] for complex input.
Example
The following example demonstrates how the arcsinh function responds to complex and real inputs.
To use the arcsinh function, we first import the numpy library, which contains it.
import numpy as npprint("Complex input:", np.arcsinh(3+2j))print("Real input:", np.arcsinh(5))
Free Resources