[Python] Matrix Multiplication 2-D and 1-D

Discussão em 'Python' iniciado por Stack, Janeiro 18, 2025.

  1. Stack

    Stack Membro Participativo

    Example:

    import numpy as np

    x = np.array([[1., 2., 3.], [4., 5., 6.]])
    y = np.ones(3)

    np.dot(x , y)


    Result:

    array([ 6., 15.])


    How is this possible when I have a matrix of (2x3) by (1x3)? It should be a 3x1 matrix.

    Continue reading...

Compartilhe esta Página