Trusted answers to developer questions

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The ** numpy.arccos() function** in Python is used to determine the inverse sine, element-wise, of a given array.

```
numpy.arccos(x, /, out=None, *, where=True)
```

The `numpy.arccos()`

function takes the following parameter values:

: This represents the x-coordinates on a unit circle. In a case where there are arguments, the domain is given as`x`

`[-1, 1]`

This is a required parameter value.: This represents a location where the result is stored. This is an optional parameter value.`out`

: This is the condition over which the input is broadcast. At a given location where this condition is`where`

`True`

, the resulting array will be set to the ufunc result. Otherwise, the resulting array will retain its original value. This is an optional parameter value.: This represents the other keyword arguments.`**kwargs`

The `numpy.arccos()`

function returns the inverse cosine of each element in a given array in radians and in a closed interval `[0, pi]`

.

import numpy as np# creating an arrayx = np.array([[1, 0], [-1, -0.5]])# taking the arccos element-wisemyarray = np.arccos(x)print(myarray)

Implementing the numpy.arccos() function

**Line 1**: We import the`numpy`

module.**Line 4**: We create an array`x`

, using the`array()`

method.**Line 7:**We implement the`np.arccos()`

function on the array. Then, we assign the result to a variable called`myarray`

.**Line 9**: We print the variable`myarray`

to the console.

RELATED TAGS

function

python

numpy

communitycreator

CONTRIBUTOR

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Keep Exploring

Related Courses