-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11.py
More file actions
51 lines (38 loc) · 932 Bytes
/
Copy path11.py
File metadata and controls
51 lines (38 loc) · 932 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import numpy as np
a = np.arange(1,10).reshape(3,3)
print(a)
b = np.arange(10,19).reshape(3,3)
print(b)
print('================================')
print(a*b)
print(np.dot(a,b))
print(np.matmul(a,b))
print('================================')
a = np.matrix(a)
b = np.matrix(b)
print(a*b)
print('================================')
a = np.arange(1,10)
b = np.ones(9)
print(a)
print(b)
print(np.dot(a,b)) # Внутреннее умножение
print('================================')
# a = np.matrix(a)
# b = np.matrix(b.reshape(-1,1))
# print(a*b)
print(np.inner(a,b)) # Внутреннее умножение
print('================================')
# Внешнее умножение
print(np.outer(a,b))
# a = np.matrix(a.reshape(-1,1))
# b = np.matrix(b)
# print(a*b)
print('================================')
a = np.array([
[1,2,3],
[1,4,9],
[1,8,27]
])
print(a)
print(np.linalg.matrix_rank(a))