FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Python-Utility-Scripts/matrix.py at main · AcoAlexDev/Python-Utility-Scripts · GitHub
AcoAlexDev
/
Python-Utility-Scripts
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Python-Utility-Scripts
/
matrix.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (26 loc) · 735 Bytes
Breadcrumbs
Python-Utility-Scripts
/
matrix.py
Copy path
File metadata and controls
34 lines (26 loc) · 735 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
numpy
as
np
def
calculateMatrixMultiplication
(
A
:
np
.
array
,
B
:
np
.
array
)
->
np
.
array
:
rowsA
=
A
.
shape
[
0
]
colsA
=
A
.
shape
[
1
]
rowsB
=
B
.
shape
[
0
]
colsB
=
B
.
shape
[
1
]
C
=
np
.
zeros
((
rowsA
,
colsB
),
dtype
=
int
)
for
r
in
range
(
rowsA
):
for
c
in
range
(
colsB
):
result
=
0
for
k
in
range
(
colsA
):
result
+=
A
[
r
][
k
]
*
B
[
k
][
c
]
C
[
r
][
c
]
=
result
print
(
result
)
return
C
def
main
()
->
None
:
A
=
np
.
array
([[
3
,
-
1
,
-
2
],
[
2
,
4
,
-
2
]
])
B
=
np
.
array
([[
2
,
-
2
],
[
3
,
1
],
[
-
2
,
4
]
])
calculateMatrixMultiplication
(
A
,
B
)
print
(
"Done"
)
main
()
Back
|
FazBrowse Home
|
New Git URL