Mathematical functions

Trigonometric functions

sin() Trigonometric sine, element-wise.
cos() Cosine elementwise.
tan() Compute tangent element-wise.
arcsin() Inverse sine, element-wise.
arccos() Trigonometric inverse cosine, element-wise.
arctan() Trigonometric inverse tangent, element-wise.
hypot(x1) Given the “legs” of a right triangle, return its hypotenuse.
arctan2(x1) Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
degrees() Convert angles from radians to degrees.
radians() Convert angles from degrees to radians.
unwrap
deg2rad() Convert angles from degrees to radians.
rad2deg() Convert angles from radians to degrees.

Hyperbolic functions

sinh() Hyperbolic sine, element-wise.
cosh() Hyperbolic cosine, element-wise.
tanh() Compute hyperbolic tangent element-wise.
arcsinh() Inverse hyperbolic sine elementwise.
arccosh() Inverse hyperbolic cosine, elementwise.
arctanh() Inverse hyperbolic tangent elementwise.

Rounding

around
round_
rint() Round elements of the array to the nearest integer.
fix
floor() Return the floor of the input, element-wise.
ceil() Return the ceiling of the input, element-wise.
trunc() Return the truncated value of the input, element-wise.

Sums, products, differences

prod
sum
nansum
cumprod
cumsum
diff
ediff1d
gradient
cross
trapz

Exponents and logarithms

exp() Calculate the exponential of all elements in the input array.
expm1() Calculate exp(x) - 1 for all elements in the array.
exp2() Calculate 2**p for all p in the input array.
log() Natural logarithm, element-wise.
log10() Return the base 10 logarithm of the input array, element-wise.
log2() Base-2 logarithm of x.
log1p() Return the natural logarithm of one plus the input array, element-wise.
logaddexp(x1) Logarithm of the sum of exponentiations of the inputs.
logaddexp2(x1) Logarithm of the sum of exponentiations of the inputs in base-2.

Other special functions

i0
sinc

Floating point routines

signbit() Returns element-wise True where signbit is set (less than zero).
copysign(x1) Change the sign of x1 to that of x2, element-wise.
frexp(out1) Split the number, x, into a normalized fraction (y1) and exponent (y2)
ldexp(x1) Compute y = x1 * 2**x2.

Arithmetic operations

add(x1) Add arguments element-wise.
reciprocal() Return the reciprocal of the argument, element-wise.
negative() Returns an array with the negative of each element of the original array.
multiply(x1) Multiply arguments element-wise.
divide(x1) Divide arguments element-wise.
power(x1) First array elements raised to powers from second array, element-wise.
subtract(x1) Subtract arguments, element-wise.
true_divide(x1) Returns a true division of the inputs, element-wise.
floor_divide(x1) Return the largest integer smaller or equal to the division of the inputs.
fmod(x1) Return the element-wise remainder of division.
mod(x1) Return element-wise remainder of division.
modf(out1) Return the fractional and integral parts of an array, element-wise.
remainder(x1) Return element-wise remainder of division.

Handling complex numbers

angle
real
imag
conj() Return the complex conjugate, element-wise.

Miscellaneous

convolve
clip
sqrt() Return the positive square-root of an array, element-wise.
square() Return the element-wise square of the input.
absolute() Calculate the absolute value element-wise.
fabs() Compute the absolute values elementwise.
sign() Returns an element-wise indication of the sign of a number.
maximum(x1) Element-wise maximum of array elements.
minimum(x1) Element-wise minimum of array elements.
nan_to_num
real_if_close
interp