Root Functions
numpy.sqrt
x: array_like - The values whose square-roots are required.out: ndarray, optional - A location into which the result is stored.where: array_like, optional - Condition to broadcast over the input.
y: ndarray - An array of the same shape asx, containing the positive square-root of each element inx.
- For real input, negative values return
nan. - For complex input, returns complex results.
- Has a branch cut on the real interval , continuous from above.
numpy.cbrt
x: array_like - The values whose cube-roots are required.out: ndarray, optional - A location into which the result is stored.where: array_like, optional - Condition to broadcast over the input.
y: ndarray - An array of the same shape asx, containing the cube root of each element inx.
Power Functions
numpy.square
x: array_like - Input data.out: ndarray, optional - A location into which the result is stored.where: array_like, optional - Condition to broadcast over the input.
out: ndarray or scalar - Element-wisex*x, of the same shape and dtype asx.
numpy.reciprocal
x: array_like - Input array.out: ndarray, optional - A location into which the result is stored.where: array_like, optional - Condition to broadcast over the input.
y: ndarray - Output array, element-wise reciprocal ofx.
- For integer input, the result is truncated toward zero.
- For floating-point input, returns exact reciprocal.
- Division by zero returns
inffor float types.
Number Theory Functions
numpy.gcd
|x1| and |x2|.
Parameters:
x1, x2: array_like, int - Arrays of values. Ifx1.shape != x2.shape, they must be broadcastable to a common shape.out: ndarray, optional - A location into which the result is stored.where: array_like, optional - Condition to broadcast over the input.
y: ndarray or scalar - The greatest common divisor of the absolute value of the inputs.
numpy.lcm
|x1| and |x2|.
Parameters:
x1, x2: array_like, int - Arrays of values. Ifx1.shape != x2.shape, they must be broadcastable to a common shape.out: ndarray, optional - A location into which the result is stored.where: array_like, optional - Condition to broadcast over the input.
y: ndarray or scalar - The lowest common multiple of the absolute value of the inputs.
Relationships and Properties
Root and Power Relationships
Inverse Relationships:
- (absolute value for real )
- (for )
- (for all real )
- (for )
GCD and LCM Relationships
Properties:
Performance Tips
See Also
Arithmetic Functions
Basic arithmetic and power operations
Trigonometric Functions
sin, cos, tan, and hypot
Exponential Functions
exp, log, and logarithms
Rounding Functions
floor, ceil, round, and truncation
