...

/

Linear Algebra and Bitwise Operations

Linear Algebra and Bitwise Operations

Learn about the usage of different linear algebra and bitwise operations in Python.

Linear algebra operations

Note the difference between the two multiplication operations shown below:

Press + to interact
import numpy as np
a1 = np.array([[10, 2],[5, 6]])
a2 = np.array([[1, 1],[2, 2]])
a3 = a1 * a2 # multiplies corresponding elements of a1 and a2
print(a3)
a3 = a1 @ a2 # performs matrix multiplication
print(a3)
a4 = a1.dot (a2) # performs matrix multiplication
print(a4)

The transpose of a matrix ...