Matrixmultiplikation 2-D und 1-D
Posted: 18 Jan 2025, 21:28
Beispiel:
Ergebnis:
Wie ist das möglich, wenn ich eine Matrix von (2x3) mal (1x3) habe? Es sollte eine 3x1-Matrix sein.
Code: Select all
import numpy as np
x = np.array([[1., 2., 3.], [4., 5., 6.]])
y = np.ones(3)
np.dot(x , y)
Code: Select all
array([ 6., 15.])