Skip to content

Instantly share code, notes, and snippets.

@aleozlx
Created August 16, 2021 00:02
Show Gist options
  • Save aleozlx/955e03bc5dbfeda2e02c9e80d18bb80a to your computer and use it in GitHub Desktop.
Save aleozlx/955e03bc5dbfeda2e02c9e80d18bb80a to your computer and use it in GitHub Desktop.
import numpy as np
np.random.seed(123)
A = np.random.randint(5, size=3*5).reshape(3, 5)
print("A =\n", A)
B = np.random.randint(5, size=5*4).reshape(5, 4)
print("B =\n", B)
C = np.dot(A, B)
print("C =\n", C)
"""
OUTPUT
=============
A =
[[2 4 2 1 3]
[2 3 1 1 0]
[1 1 0 0 1]]
B =
[[3 4 0 0]
[4 1 3 2]
[4 2 4 0]
[0 1 3 4]
[4 4 1 3]]
C =
[[42 29 26 21]
[22 14 16 10]
[11 9 4 5]]
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment