What is the numpy.sinh() function in Python?
Overview
The numpy.sinh() function in Python computes an input array x's hyperbolic sine, element-wise.
Mathematically:
Also:
sinhx =
Syntax
numpy.sinh(x, /, out=None, *, where=True)
Parameter value
The numpy.sinh() function takes the following parameter values:
x(required): This represents the input array.out(optional): This represents the location where the result is stored.where(optional): This is the condition over which the input is being broadcast. At a given location where this condition isTrue, the resulting array will be set to theufuncresult. Otherwise, the resulting array will retain its original value. This is optional.**kwargs(optional): This represents other keyword arguments. This is optional.
Return value
The numpy.sinh() function returns the corresponding hyperbolic sine values of each element in a given array.
Example
import numpy as np# creating an arrayx = np.array([30, 45, 60, 90, 180])# taking the hyperbolic sinemyarray = np.sinh(x)print(myarray)
Explanation
- Line 1: We import the
numpymodule. - Line 4: We create an array,
x, using thearray()method. - Line 7: We implement the
np.sinh()function on the array. The result is assigned to a variable,myarray. - Line 9: We print the
myarrayvariable.