Numpy Must Functions
Numpy Must Functions
2. **Array Manipulation**
- `numpy.reshape()`: Change the shape of an array.
- `numpy.flatten()`: Flatten a multi-dimensional array into a 1D
array.
- `numpy.transpose()`: Transpose an array.
- `numpy.concatenate()`: Join two or more arrays.
- `numpy.split()`: Split an array into multiple sub-arrays.
- `numpy.stack()`: Stack arrays along a new axis.
3. **Mathematical Operations**
- `numpy.add()`: Element-wise addition.
- `numpy.subtract()`: Element-wise subtraction.
- `numpy.multiply()`: Element-wise multiplication.
- `numpy.divide()`: Element-wise division.
- `numpy.dot()`: Dot product of two arrays.
- `numpy.sqrt()`: Element-wise square root.
- `numpy.exp()`: Element-wise exponential.
- `numpy.log()`: Element-wise natural logarithm.
4. **Statistical Operations**
- `numpy.mean()`: Compute the arithmetic mean.
- `numpy.median()`: Compute the median.
- `numpy.std()`: Compute the standard deviation.
- `numpy.var()`: Compute the variance.
- `numpy.min()`: Find the minimum value.
- `numpy.max()`: Find the maximum value.
- `numpy.sum()`: Compute the sum of array elements.
5. **Indexing and Slicing**
- `numpy.where()`: Return elements based on a condition.
- `numpy.take()`: Take elements from an array along an axis.
- `numpy.put()`: Replaces specified elements of an array with
given values.
- `numpy.choose()`: Construct an array from an index array and a
set of arrays to choose from.
6. **Linear Algebra**
- `numpy.linalg.inv()`: Compute the inverse of a matrix.
- `numpy.linalg.det()`: Compute the determinant of a matrix.
- `numpy.linalg.eig()`: Compute the eigenvalues and eigenvectors
of a matrix.
- `numpy.linalg.svd()`: Singular Value Decomposition.
8. **Utility Functions**
- `numpy.copy()`: Return a copy of an array.
- `numpy.unique()`: Find the unique elements of an array.
- `numpy.sort()`: Sort an array.
- `numpy.argsort()`: Returns the indices that would sort an array.
These functions cover a wide range of operations that you can perform with NumPy arrays.