[go: up one dir, main page]

0% found this document useful (0 votes)
2 views2 pages

Numpy Must Functions

The document provides a comprehensive list of commonly used NumPy functions categorized into eight sections: Array Creation, Array Manipulation, Mathematical Operations, Statistical Operations, Indexing and Slicing, Linear Algebra, Random Number Generation, and Utility Functions. Each section includes specific functions along with brief descriptions of their purposes. These functions enable a wide range of operations on NumPy arrays.

Uploaded by

ah.jubair110
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Numpy Must Functions

The document provides a comprehensive list of commonly used NumPy functions categorized into eight sections: Array Creation, Array Manipulation, Mathematical Operations, Statistical Operations, Indexing and Slicing, Linear Algebra, Random Number Generation, and Utility Functions. Each section includes specific functions along with brief descriptions of their purposes. These functions enable a wide range of operations on NumPy arrays.

Uploaded by

ah.jubair110
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Certainly!

Here is a list of some basic and commonly used functions in


[NumPy](https://numpy.org/doc/stable/reference/generated/numpy.array.html):
1. **Array Creation**
- `numpy.array()`: Create an array.
- `numpy.zeros()`: Create an array of zeros.
- `numpy.ones()`: Create an array of ones.
- `numpy.empty()`: Create an uninitialized array.
- `numpy.arange()`: Create an array with a range of values.
- `numpy.linspace()`: Create an array with linearly spaced values.
- `numpy.eye()`: Create an identity matrix.

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.

7. **Random Number Generation**


- `numpy.random.rand()`: Generate random numbers from a
uniform distribution.
- `numpy.random.randn()`: Generate random numbers from a
normal distribution.
- `numpy.random.randint()`: Generate random integers.

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.

You might also like