Numpy arccos() method

This function is used to calculate the inverse cos of the array elements.

Syntax

snippet
numpy.arccos(array, out)

Parameters

  1. array: these are the array elements of which, the inverse cos values are to be calculated.
  2. Out: It is the shape of the output array.

Return

It returns an array containing the inverse cos for all the array elements, x.

Example

snippet
import numpy as np 

arr = [0, 0.3, -1] 
print ("Input array : \n", arr) 

arccos_val = np.arccos(arr) 
print ("\nInverse cos values : \n", arccos_val)

Output:

Output
Input array : [0, 0.3, -1] Inverse cos values : [1.57079633 1.26610367 3.14159265]
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents