-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpy_5.py
More file actions
26 lines (22 loc) · 845 Bytes
/
py_5.py
File metadata and controls
26 lines (22 loc) · 845 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
print("Matrix operation ..\n")
matrix = np.array( [ [ 4, 5, 6 ],
[ 7, 8, 9 ],
[ 10, 11, 12 ] ] )
matrix1 = np.array( [ [ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ] ] )
mat = np.random.rand(4)
print(matrix)
print(matrix1)
print("\nTranspot of matrix\n",matrix.transpose())
print("Array of random ",mat)
mat.sort()
print("\n sort all element from matrix\n",mat)
print("\nAddition of two matrix \n",matrix+matrix1)
print("\nMultiplication of two matrix \n",matrix*matrix1)
print("\nMinimum element from matrix \n",matrix.max())
print("\nMultiplication of from matrix \n",matrix.min())
print("\nSum of the matrix \n",matrix.sum())
print("\nAverage of matrix \n",matrix.mean())
print("\nProduct of matrix \n",matrix.prod())