gabboshow
gabboshow

Reputation: 5549

multiplication matrices python

I have the following variables:

A of dimensions [126 X 3] B of dimensions [3 x 2]

what is the python equivalent of the matlab multipication C = A*B'

C is a matrix of dimension [126 x 2]

Upvotes: 0

Views: 86

Answers (2)

TheBlackCat
TheBlackCat

Reputation: 10298

For Python 3.5 or later, you can use the @ matrix multiplication operator:

C = A@B

Upvotes: 1

McN
McN

Reputation: 63

import numpy as np

c = np.dot(a, b)

Upvotes: 2

Related Questions