numpy.linalg.det() Method in Python Last Updated : 29 Jul, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report In NumPy, we can compute the determinant of the given square array with the help of numpy.linalg.det(). It will take the given square array as a parameter and return the determinant of that. Syntax: numpy.linalg.det() Parameter: An square array. Return: The determinant of that square array. Example 1: Python import numpy as np from numpy import linalg as LA array1 = np.array([[1, 2], [3, 4]]) # Original 2-d array print(array1) # Determinant of the said 2-D array print(np.linalg.det(array1)) Output: [[1 2] [3 4]] -2.0000000000000004 Example 2: Python import numpy as np from numpy import linalg as LA array1 = np.array([[1, 2, 3], [3, 4, 1], [3, 2, 1]]) # Original 2-d array print(array1) # Determinant of the said 2-D array print(np.linalg.det(array1)) Output: [[1 2 3] [3 4 1] [3 2 1]] -15.999999999999998 Comment More infoAdvertise with us Next Article numpy.nanstd() function - Python V vipinyadav15799 Follow Improve Article Tags : Python Python-numpy Python numpy-Matrix Function Practice Tags : python Similar Reads numpy.linalg.eig() Method in Python In NumPy we can compute the eigenvalues and right eigenvectors of a given square array with the help of numpy.linalg.eig(). It will take a square array as a parameter and it will return two values first one is eigenvalues of the array and second is the right eigenvectors of a given square array. Syn 1 min read Python | Numpy np.eigvals() method With the help of np.eigvals() method, we can get the eigen values of a matrix by using np.eigvals() method. Syntax : np.eigvals(matrix) Return : Return the eigen values of a matrix. Example #1 : In this example we can see that by using np.eigvals() method, we are able to get the eigen values of a ma 1 min read numpy.diag_indices() in Python The numpy.diag_indices() function returns indices in order to access the elements of main diagonal of a array with minimum dimension = 2. Returns indices in the form of tuple. to access the main diagonal of an array. Syntax: numpy.diag_indices(n, n_dim = 2) Parameters : n : size of array, for whic 2 min read numpy.nanstd() function - Python numpy.nanstd() function compute the standard deviation along the specified axis, while ignoring NaNs. Syntax : numpy.nanstd(arr, axis = None, dtype = None, out = None, ddof = 0, keepdims) Parameters : arr : [array_like] Calculate the standard deviation of the non-NaN values. axis : [{int, tuple of i 2 min read Python | Numpy np.lagcompanion() method np.lagcompanion() method is used to return the companion matrix of Laguerre series. Syntax : np.lagcompanion(c) Parameters: c :[array_like] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Companion matrix of dimensions (deg, deg). Code #1 : Python3 # Python pr 1 min read numpy.nonzero() in Python numpy.nonzero() function returns the indices of the elements in an array that are non-zero. It is commonly used to find the positions of non-zero (or True) elements in arrays.Example:Pythonimport numpy as np a = np.array([0, 2, 0, 3, 0, 4]) res = np.nonzero(a) print(res)Output(array([1, 3, 5]),) Exp 2 min read Like