NumPy is a popular Python library that is used for scientific computing. It is an open-source library that provides support for large, multi-dimensional arrays and matrices, along with a wide range of mathematical functions to operate on these arrays. NumPy is widely used in data science, machine learning, and scientific research.
NumPy is built on top of the Python programming language and provides a powerful set of tools for working with numerical data. It is designed to be fast and efficient, making it ideal for working with large datasets. NumPy is also highly optimized for numerical operations, making it a popular choice for scientific computing.
Cheat Sheet
Function | Description |
---|---|
numpy.array() | Creates a numpy array |
numpy.zeros() | Creates an array of zeros |
numpy.ones() | Creates an array of ones |
numpy.arange() | Creates an array with evenly spaced values |
numpy.linspace() | Creates an array with evenly spaced values within a specified range |
numpy.random.rand() | Creates an array of random values between 0 and 1 |
numpy.random.randn() | Creates an array of random values from a normal distribution |
numpy.reshape() | Reshapes an array |
numpy.transpose() | Transposes an array |
numpy.concatenate() | Concatenates two or more arrays |
numpy.split() | Splits an array into multiple sub-arrays |
numpy.max() | Returns the maximum value in an array |
numpy.min() | Returns the minimum value in an array |
numpy.mean() | Returns the mean of an array |
numpy.median() | Returns the median of an array |
numpy.std() | Returns the standard deviation of an array |
numpy.var() | Returns the variance of an array |
numpy.dot() | Computes the dot product of two arrays |
numpy.sum() | Returns the sum of an array |
numpy.prod() | Returns the product of an array |
numpy.absolute() | Returns the absolute value of an array |
numpy.exp() | Returns the exponential value of an array |
numpy.log() | Returns the natural logarithm of an array |
numpy.sin() | Returns the sine of an array |
numpy.cos() | Returns the cosine of an array |
numpy.tan() | Returns the tangent of an array |
numpy.arcsin() | Returns the inverse sine of an array |
numpy.arccos() | Returns the inverse cosine of an array |
numpy.arctan() | Returns the inverse tangent of an array |
Reference: NumPy User Guide