Linear Algebra and Bitwise Operations
Learn about the usage of different linear algebra and bitwise operations in Python.
We'll cover the following...
Linear algebra operations
Note the difference between the two multiplication operations shown below:
Press + to interact
import numpy as npa1 = np.array([[10, 2],[5, 6]])a2 = np.array([[1, 1],[2, 2]])a3 = a1 * a2 # multiplies corresponding elements of a1 and a2print(a3)a3 = a1 @ a2 # performs matrix multiplicationprint(a3)a4 = a1.dot (a2) # performs matrix multiplicationprint(a4)
The transpose of a matrix ...