-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram3.py
More file actions
26 lines (24 loc) · 931 Bytes
/
program3.py
File metadata and controls
26 lines (24 loc) · 931 Bytes
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
import numpy as np
a=np.array([1,2,3,4,5])
b=np.array([6,7,8,9,10])
print("array a:",a)
print("array b:",b)
print("Sum of the 2 arrays a and b :",np.add(a,b))
print("Difference of the 2 arrays a and b :",np.subtract(a,b))
print("Product of the 2 arrays a and b:",np.multiply(a,b))
print("Quotient of the 2 arrays a and b:",np.divide(a,b))
print("Squares of the elements in array a :",np.sqrt(a))
print("exponentials of the elements in array b:",np.exp(b))
print("Minimum value of the array a:",np.min(a))
print("Maximum value of array b:",np.max(b))
print("mean of the array a:",np.mean(a))
print("Standard deviation of the array b:",np.std(b))
print("Sum of the elements in array a:",np.sum(a))
c=np.array([[1,2],[3,4],[5,6]])
print("Array c:",c)
print("Reshaped array with 2 rows and 3 columns:")
print(np.reshape(c,(2,3)))
d=np.array([[2,3,4],[5,6,7]])
print("Array d:",d)
print("Transpose of array d:")
print(np.transpose(d))