-
Notifications
You must be signed in to change notification settings - Fork 0
/
12.py
36 lines (36 loc) · 800 Bytes
/
12.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
34
35
36
#UFUNC SIMPLE ARITHMETIC
import numpy as np
arr1 = np.array([10, 11, 12, 13, 14, 15])
arr2 = np.array([2, 1, 6, 4, 7, 3])
print("Addition")
newarr = np.add(arr1, arr2)
print(newarr)
print("\n")
print("Subtraction")
newarr = np.subtract(arr1, arr2)
print(newarr)
print("\n")
print("Multiplication")
newarr = np.multiply(arr1, arr2)
print(newarr)
print("\n")
print("Division")
newarr = np.divide(arr1, arr2)
print(newarr)
print("\n")
print("Power")
newarr = np.power(arr1, arr2)
print(newarr)
print("\n")
print("Remainder")
newarr = np.mod(arr1, arr2)
print(newarr)
print("\n")
print("Quotient and Mod")
newarr = np.divmod(arr1, arr2)
print(newarr)
print("\n")
print("Absolute Values")
arr3 = np.array([-1, -2, 1, 2, 3, -4])
newarr = np.absolute(arr3)
print(newarr)