This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / lib / scimath / arccos

_ArrayFunctionDispatcher

numpy.lib.scimath:arccos

source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_scimath_impl.py :494

Signature

def   arccos ( x )

Summary

Compute the inverse cosine of x.

Extended Summary

Return the "principal value" (for a description of this, see numpy.arccos) of the inverse cosine of x. For real x such that abs(x) <= 1, this is a real number in the closed interval . Otherwise, the complex principle value is returned.

Parameters

x : array_like or scalar

The value(s) whose arccos is (are) required.

Returns

out : ndarray or scalar

The inverse cosine(s) of the x value(s). If x was a scalar, so is out, otherwise an array object is returned.

Notes

For an arccos() that returns NAN when real x is not in the interval [-1,1], use numpy.arccos.

Examples

import numpy as np
np.set_printoptions(precision=4)
np.emath.arccos(1) # a scalar is returned
np.emath.arccos([1,2])

See also

numpy.arccos

Aliases

  • numpy.emath.arccos