Dot product, matrix multiplication (@ / matmul), determinant, and matrix inverse.
NumPy links directly to hardware-accelerated BLAS/LAPACK libraries to provide high-speed matrix multiplication (`@`), determinants, matrix inverses, and traces.
`*` is element-by-element multiplication. `@` (or `matmul`) is true linear algebra matrix multiplication (dot products of rows against columns).
`A * B` is element-wise multiplication (requires compatible shapes). `A @ B` is true algebraic matrix product (requires columns of A == rows of B).
C = A @ B; det = np.linalg.det(A); inv = np.linalg.inv(A)Visualize multidimensional ndarrays in full 3D space with depth, row, and column slice planes.
tensor = np.arange(10, 37).reshape(3, 3, 3)Full 3D ndarray Tensor. Shape: (3, 3, 3) • 27 elements in RAM
C = A * B # Intending matrix multiplication but did element-wise math!C = A @ B # or np.matmul(A, B)Always use `@` or `np.matmul()` for mathematical matrix multiplication.
Solve the objective below using NumPy vectorized syntax
Create `A = np.array([[1, 2], [3, 4]])` and `B = np.array([[2, 0], [1, 2]])`, compute `A @ B`, and print.
[[ 4 4]
[10 8]]