Numpy Math Functions

 `a` Input array with degree `out` Optional , ndarray to store result `where` Optional , array with True to get values and False to leave the value

## Examples

We will use the options in our sample scripts.
``````import numpy as np
print(ar_deg) # output in degree``````
Output
``[ 90.00000018 119.99999986 159.99999982 179.99999979]``
In above output in degree we can use round() to roundup the values to nearest number. The last line we will change.
``print(np.round(ar_deg))``
Output
``[ 90. 120. 160. 180.]``

## dtype

We will use dtype=float
``````import numpy as np
print(ar_deg)``````
Output
``[119.99999986 159.99999982 179.99999979]``

## where

Value to convert to radian or not we can decide by using another array filled with True and False.
``````import numpy as np
ar_where=np.array([True,False,True])
print(ar_deg)``````
Output
``[119.99999986   2.7925268  179.99999979]``

## out

We can store the output in an array. We used shape() to create array (ar_out) of same shape() of our main array ar_rad.
We used ones() to create array of same shape() of our input array with degree values.
``````import numpy as np
print(ar_deg)
print(ar_out)

Output
``````[119.99999986 159.99999982 179.99999979]
[119.99999986 159.99999982 179.99999979]
False``````

Subscribe to our YouTube Channel here

## Subscribe

* indicates required
Subscribe to plus2net

plus2net.com