Skip to content

Commit 00d4bc5

Browse files
committed
Adding Matrix
1 parent 933b0d2 commit 00d4bc5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Python/Matrix/main.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import numpy
2+
import sys
3+
4+
# general list
5+
list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
6+
7+
# matrix list
8+
matrix_list = list
9+
10+
print(matrix_list)
11+
print(type(matrix_list))
12+
print("Size of matrix list in bytes = ", sys.getsizeof(matrix_list) * len(matrix_list))
13+
14+
# matrix array
15+
matrix_arr = numpy.array(list)
16+
17+
print(matrix_arr)
18+
print(type(matrix_arr))
19+
print("Size of matrix array in bytes =", matrix_arr.size * matrix_arr.itemsize)

0 commit comments

Comments
 (0)