October 2019
Beginner to intermediate
674 pages
16h 43m
English
Linear algebra constitutes a set of vital operations for matrices and arrays. The NumPy package is built with a special module called linalg to deal with all linear algebra requirements. The following segment discusses some frequently used functions of the linalg module in detail.
The dot function of the linalg module helps in matrix multiplication. For 2D arrays, it behaves exactly like matrix multiplication. It requires the last dimension of the first array to be equal to the last dimension of the second array. The arrays need not have equal numbers of dimensions. For an N-dimensional array, the output will have 2N-2 dimensions:
# For 2D arraysIn [23]: array_1 = np.random.randn(2, 4)In [24]: array_2 = np.random.randn(4, ...
Read now
Unlock full access