Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3aeb562

Browse filesBrowse files
committed
matrix multiplication
1 parent 201cba8 commit 3aeb562
Copy full SHA for 3aeb562

File tree

1 file changed

+11
-0
lines changed
Filter options

1 file changed

+11
-0
lines changed
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import numpy as np
2+
from matrix_utils import non_square_matrix
3+
4+
first_matrix = non_square_matrix()
5+
second_matrix = non_square_matrix()
6+
7+
if first_matrix.shape[1] != second_matrix.shape[0]:
8+
print('The number of columns in thr first matrix must be equal to the number of rows in the second matrix')
9+
else:
10+
product = np.dot(first_matrix, second_matrix)
11+
print(f'[first matrix] x [second matrix]: {product}')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.