Created
November 5, 2020 15:06
-
-
Save timurbakibayev/9d43c824ccf071e9cca383fa9153f16d to your computer and use it in GitHub Desktop.
Matrix Multiplication in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 300 | |
a = np.ones((n,n)) | |
b = np.ones((n,n)) | |
c = np.zeros((n,n)) | |
start_time = time.time() | |
for i in range(n): | |
for j in range(n): | |
for k in range(n): | |
c[i][j] += a[i][k] * b[k][j] | |
print(f"I did it in {time.time() - start_time} sec." ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment