-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions_numpy.py
33 lines (31 loc) · 1.21 KB
/
functions_numpy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
Basic numpy functions.
"""
import numpy as np
import math
print('***I was created for some often used numpy functions purpose to understand Mr.Jha*** ')
a = [0, .5, .2]
print('This list is used for the following numpy functions', a)
print('Inverse of cos values are ', np.arccos(a))
print('Inverse of sin values are ', np.arcsin(a))
print('Inverse of tan values are ', np.arctan(a))
print('The degrees value are ', np.degrees(a))
print('The values of tan are', np.tan(a))
print('The hyperbolic values of tanh are', np.tanh(a))
print('The conversion of degree to radian are', np.deg2rad(a))
print('Inverse value of sinh are ', np.arcsinh(a))
print('Inverse value of tanh are ', np.arctanh(a))
b = [10, 5, 3]
c = [2, 6, 4]
print('The hypotenuse is ', np.hypot(b, c))
print('Math function', math.pi)
d = [90, 45, 30, 60]
print('Degree to radian value', np.deg2rad(d))
print('Radian to degree value are', np.rad2deg(a))
print('Radians value', np.radians(d))
e = [0.1, 2.2, 3.2, 5.6]
print('Input array for ceil', e)
print('Output array for ceil', np.ceil(e))
print('Same array output for floor', np.floor(e))
print('Same array output for fix', np.fix(e))
print('Same array output for rint', np.rint(e))