Mathematical functions¶
Note
Currently, most of the math functions only support inputs and outputs of the same dtype. This limitation usually results in imprecise outputs for ndarrays with integral dtype while floating-point values are expected in the output. Appropriate handling of ndarrays integral dtypes is in active development.
Trigonometric functions¶
|
Trigonometric sine, element-wise. |
|
Cosine, element-wise. |
|
Compute tangent element-wise. |
|
Inverse sine, element-wise. |
|
Trigonometric inverse cosine, element-wise. |
|
Trigonometric inverse tangent, element-wise. |
|
Convert angles from radians to degrees. |
|
Convert angles from degrees to radians. |
|
Given the “legs” of a right triangle, return its hypotenuse. |
|
Element-wise arc tangent of |
|
Convert angles from degrees to radians. |
|
Convert angles from radians to degrees. |
|
Unwrap by changing deltas between values to 2*pi complement. |
Hyperbolic functions¶
|
Hyperbolic sine, element-wise. |
|
Hyperbolic cosine, element-wise. |
|
Compute hyperbolic tangent element-wise. |
|
Inverse hyperbolic cosine, element-wise. |
|
Inverse hyperbolic cosine, element-wise. |
|
Inverse hyperbolic tangent, element-wise. |
Rounding¶
|
Round elements of the array to the nearest integer. |
|
Round an array of floats element-wise to nearest integer towards zero. |
|
Return the floor of the input, element-wise. |
|
Return the ceiling of the input, element-wise. |
|
Return the truncated value of the input, element-wise. |
|
Evenly round to the given number of decimals. |
|
Round an array to the given number of decimals. |
Sums, products, differences¶
|
Sum of array elements over a given axis. |
|
Return the product of array elements over a given axis. |
|
Return the cumulative sum of the elements along a given axis. |
|
Return the product of array elements over a given axis treating Not a Numbers (NaNs) as ones. |
|
Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. |
|
Return the cumulative product of elements along a given axis. |
|
Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one. |
|
Return the cumulative sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. |
|
Calculate the n-th discrete difference along the given axis. |
|
The differences between consecutive elements of an array. |
|
Return the cross product of two (arrays of) vectors. |
|
Integrate along the given axis using the composite trapezoidal rule. |
Exponents and logarithms¶
|
Calculate the exponential of all elements in the input array. |
|
Calculate exp(x) - 1 for all elements in the array. |
|
Natural logarithm, element-wise. |
|
Return the base 10 logarithm of the input array, element-wise. |
|
Base-2 logarithm of x. |
|
Return the natural logarithm of one plus the input array, element-wise. |
|
Logarithm of the sum of exponentiations of the inputs. |
Floating point routines¶
|
Returns x1 * 2**x2, element-wise. |
|
Returns element-wise True where signbit is set (less than zero). |
|
Change the sign of x1 to that of x2, element-wise. |
|
Decompose the elements of x into mantissa and twos exponent. |
|
Return the distance between x and the nearest adjacent number. |
Rational routines¶
|
Returns the lowest common multiple of |
|
Returns the greatest common divisor of |
Arithmetic operations¶
|
Add arguments element-wise. |
|
Return the reciprocal of the argument, element-wise. |
|
Numerical negative, element-wise. |
|
Returns a true division of the inputs, element-wise. |
|
First array elements raised to powers from second array, element-wise. |
|
Subtract arguments element-wise. |
|
Return element-wise remainder of division. |
|
Multiply arguments element-wise. |
|
Returns a true division of the inputs, element-wise. |
|
Return element-wise remainder of division. |
|
Computes the numerical positive of each element x_i (i.e.,`y_i = +x_i`) of the input array x . |
|
First array elements raised to powers from second array, element-wise. |
|
Return element-wise remainder of division. |
|
Return the fractional and integral parts of an array, element-wise. |
|
Return element-wise quotient and remainder simultaneously. |
|
Return the largest integer smaller or equal to the division of the inputs. |
Miscellaneous¶
|
Clip (limit) the values in an array. |
|
Return the non-negative square-root of an array, element-wise. |
|
Return the cube-root of an array, element-wise. |
|
Return the element-wise square of the input. |
|
Calculate the absolute value element-wise. |
|
Returns an element-wise indication of the sign of a number. |
|
Returns element-wise maximum of the input arrays with broadcasting. |
|
Returns element-wise minimum of the input arrays with broadcasting. |
|
Calculate the absolute value element-wise. |
|
Compute the Heaviside step function. |
|
Returns element-wise maximum of the input arrays with broadcasting. |
|
Returns element-wise minimum of the input arrays with broadcasting. |
|
Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the numbers defined by the user using the nan, posinf and/or neginf keywords. |
|
One-dimensional linear interpolation. |