NumPy is a popular Python library for numerical computing and data analysis. Here are some of the most important NumPy functions used in data science:
numpy.array()
: Creates a NumPy arraynumpy.arange()
: Returns evenly spaced values within a given intervalnumpy.linspace()
: Returns evenly spaced numbers over a specified intervalnumpy.zeros()
: Creates an array filled with zerosnumpy.ones()
: Creates an array filled with onesnumpy.eye()
: Creates a 2-D array with ones on the diagonal and zeros elsewherenumpy.random.rand()
: Generates an array of random numbersnumpy.random.randn()
: Generates an array of random numbers with a normal distributionnumpy.reshape()
: Changes the shape of an arraynumpy.transpose()
: Transposes an arraynumpy.dot()
: Computes the dot product of two arraysnumpy.sum()
: Calculates the sum of array elementsnumpy.mean()
: Calculates the mean of array elementsnumpy.std()
: Calculates the standard deviation of array elementsnumpy.max()
: Returns the maximum value of an arraynumpy.min()
: Returns the minimum value of an arraynumpy.argmax()
: Returns the index of the maximum value in an arraynumpy.argmin()
: Returns the index of the minimum value in an arraynumpy.unique()
: Finds the unique elements in an arraynumpy.concatenate()
: Joins two or more arrays together
These functions are just a small subset of what NumPy has to offer, but they are some of the most frequently used functions in data science.