The numpy.arcsin()
function in Python is used to determine the inverse sine, element-wise, of a given array.
numpy.arcsin(x, /, out=None, *, where=True)
The numpy.arcsin()
function takes the following parameter values:
x
: This represents the y-coordinate on the unit circle. This parameter value is required for the function to work.out
: This represents a location where the result is stored. This is an optional parameter value.where
: This is the condition over which the input is broadcast. At a given location where this condition is True
, the resulting array will be set to the ufunc result. Otherwise, the resulting array will retain its original value. This is also an optional parameter value.**kwargs
: This represents the other keyword arguments.The numpy.arcsin()
function returns the inverse sin of each element in a given array in radians and in a closed interval [-pi/2, pi/2]
.
import numpy as np# creating an arrayx = np.array([[1, 0], [-1, -0.5]])# taking the arcsin element-wisemyarray = np.arcsin(x)print(myarray)
numpy
module.x
, using the array()
method.np.arcsin()
function on the array. Then, we assign the result to a variable called myarray
.myarray
to the console.