What is Matrix Multiplication?
- Matrix multiplication is an operation used to multiply two compatible arrays or matrices.
NumPy provides two common ways:
a @ b
and
np.matmul(a, b)
Step 1:
Output:
Universal Functions
- Cumulative Sum – cumsum()
What is cumsum()?
- cumsum() calculates the running total of the elements.
Step 1:
Output:
- Cumulative Product – cumprod()
What is cumprod()?
- cumprod() calculates the running multiplication of the elements.
Step 1:
Output:
Minimum and Maximum
- NumPy provides functions to find the smallest and largest values.
min() & argmin()
- min() returns the smallest value.
- argmin() returns the index of the minimum value.
Step 1:
Output:
max() & argmax()
- max() returns the largest value.
- argmax() returns the index of the maximum value.
Step 1:
Output:








Top comments (0)