Common Numpy Operations

FunctionsWhat it does
np.array()Creates a new NumPy array.
np.zeros()Returns a new array of given shape and type, filled with zeros.
np.ones()Returns a new array of given shape and type, filled with ones.
np.arange()Returns evenly spaced values within a given interval.
np.linspace()Returns evenly spaced numbers over a specified interval.
np.reshape()Gives a new shape to an array without changing its data.
np.append()Appends values to the end of an array.
np.concatenate()Joins a sequence of arrays along an existing axis.
np.sum()Sum of array elements over a given axis.
np.mean()Computes the arithmetic mean along the specified axis.
np.median()Computes the median along the specified axis.
np.std()Computes the standard deviation along the specified axis.
np.var()Computes the variance along the specified axis.
np.min()Returns the minimum of an array or minimum along an axis.
np.max()Returns the maximum of an array or maximum along an axis.
np.dot()Dot product of two arrays.
np.cross()Cross product of two arrays.
np.sort()Returns a sorted copy of an array.
np.argsort()Returns the indices that would sort an array.
np.unique()Finds the unique elements of an array.
np.linalg.inv()Computes the multiplicative inverse of a matrix.
np.linalg.det()Computes the determinant of an array.
np.linalg.eig()Computes the eigenvalues and right eigenvectors of a square array.
np.linalg.eigh()Computes the eigenvalues and eigenvectors of a Hermitian or symmetric matrix.
np.linalg.solve()Solves a linear matrix equation, or system of linear scalar equations.
np.linalg.svd()Performs singular value decomposition.
np.linalg.pinv()Computes the Moore-Penrose pseudoinverse of a matrix.
np.linalg.norm()Computes the norm of a vector or matrix.
np.linalg.qr()Computes the QR decomposition of a matrix.
np.linalg.cholesky()Computes the Cholesky decomposition of a matrix.