Skip to content

Instantly share code, notes, and snippets.

@Mynuddin-dev
Last active April 21, 2022 09:57
Show Gist options
  • Save Mynuddin-dev/5d1f7658a44a4de363fc01414284e33f to your computer and use it in GitHub Desktop.
Save Mynuddin-dev/5d1f7658a44a4de363fc01414284e33f to your computer and use it in GitHub Desktop.
Matrix Multiplication
A = np.array([[1, 2],[3,4],[5,6]])
B = np.array([[1, 2, 3], [4, 5, 6]])
Result=[]
for i in range(0,len(A)):
temp=[]
for j in range(0,len(B[0])):
s = 0
for k in range(0,len(A[0])):
s += A[i][k]*B[k][j]
temp.append(s)
Result.append(temp)
print(Result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment