Thursday, September 10, 2020

python program to perform cosine operation on a numpy array

 python program to perform cosine operation on a numpy array


 

 

python program to perform cosine operation on a

 numpy array

=========================================

     method : cos(arr)

This method calculates the cosine value of each

element in the array 'arr'

=========================================

 

code

from numpy import *

arr = array([0,30,60,90])

print("Original Array:", arr)

print("Cosine values:",cos(arr))

 

 

Output

[1,0.866,0.5,0]

 

 

 


No comments:

Post a Comment

Durga Puja in Odisha

 Durga Puja in Odisha