-
Notifications
You must be signed in to change notification settings - Fork 1
Python Multiplications
Shi Jin edited this page Feb 6, 2018
·
1 revision
https://docs.scipy.org/doc/numpy/reference/generated/numpy.multiply.html#numpy.multiply
https://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html
If both a and b are 2-D arrays, it is matrix multiplication, but using matmul or a @ b is preferred.
https://docs.scipy.org/doc/numpy/reference/generated/numpy.matmul.html#numpy.matmul
If both arguments are 2-D they are multiplied like conventional matrices. The matmul function implements the semantics of the @ operator introduced in Python 3.5 following PEP465.
- Multiplication by scalars is not allowed.
- Stacks of matrices are broadcast together as if the matrices were elements.