Numpy matrix.I function | Python Last Updated : 22 Apr, 2020 Comments Improve Suggest changes Like Article Like Report With the help ofnumpy.matrix.I() function we can get the multiplicative inverse of the same size as of our given matrix. Syntax : numpy.matrix.I() Return : [matrix object] If self is non-singular, ret is such that ret * self == self * ret == np.matrix(np.eye(self[0, :].size) all return True. Return multiplicative inverse of given matrix. Code #1 : Python3 # Python program explaining # numpy.matrix.I() function # importing numpy as geek import numpy as geek mat = geek.matrix('[3, 4; 5, 6]') # applying matrix.getI() method gfg = mat.getI() print(gfg) Output : [[-3. 2. ] [ 2.5 -1.5]] Code #2 : Python3 # Python program explaining # numpy.matrix.I() function # importing numpy as geek import numpy as geek mat = geek.matrix('[1, 2, 3; 4, 5, 6; 7, 8, 9]') # applying matrix.getI() method gfg = mat.getI() print(gfg) Output : [[ -4.50359963e+15 9.00719925e+15 -4.50359963e+15] [ 9.00719925e+15 -1.80143985e+16 9.00719925e+15] [ -4.50359963e+15 9.00719925e+15 -4.50359963e+15]] Comment More infoAdvertise with us Next Article Numpy matrix.I function | Python sanjoy_62 Follow Improve Article Tags : Machine Learning Python-numpy Python numpy-Matrix Function python Practice Tags : Machine Learningpython Similar Reads numpy.matrix.A() function - Python numpy.matrix.A() function return self as an ndarray object. Syntax : numpy.matrix.A() Parameters : None Return : [ndarray] Return self as an ndarray. Code #1 : Python3 # Python program explaining # numpy.matrix.A() function # importing numpy as geek import numpy as geek mat = geek.matrix(geek.arange 1 min read numpy.imag() function - Python numpy.imag() function return the imaginary part of the complex argument. Syntax : numpy.imag(arr) Parameters : arr : [array_like] Input array. Return : [ndarray or scalar] The imaginary component of the complex argument. If val is real, the type of val is used for the output. If val has complex elem 1 min read numpy.ix_() function | Python numpy.ix_() function construct an open mesh from multiple sequences. This function takes N 1-D sequences and returns N outputs with N dimensions each, such that the shape is 1 in all but one dimension and the dimension with the non-unit shape value cycles through all N dimensions. Syntax : numpy.ix_ 1 min read numpy.i0() function | Python numpy.i0() function is the modified Bessel function of the first kind, order 0. it's usually denoted by I0. Syntax : numpy.i0(x) Parameters : x : [array_like, dtype float or complex] Argument of the Bessel function. Return : [ndarray, shape = x.shape, dtype = x.dtype] The modified Bessel function ev 1 min read numpy.matrix() in Python This class returns a matrix from a string of data or array-like object. Matrix obtained is a specialised 2D array. Syntax : numpy.matrix(data, dtype = None) : Parameters : data : data needs to be array-like or string dtype : Data type of returned array. Returns : data interpreted as a matrix Python 1 min read numpy.matlib.zeros() function | Python numpy.matlib.zeros() function return matrix of given shape and type, filled with zeros. Syntax : numpy.matlib.zeros(shape, dtype = None, order = 'C') Parameters : shape : [sequence of ints] Shape of the empty matrix. dtype : [data-type, optional] The desired data-type for the matrix, default is floa 1 min read numpy.matlib.empty() function | Python numpy.matlib.empty() function return a new matrix of given shape and type, without initializing entries. Syntax : numpy.matlib.empty(shape, dtype = None, order = 'C') Parameters : shape : [int or tuple of int] Shape of the empty matrix. dtype : [data-type, optional] Desired output data-type. order : 1 min read numpy.mask_indices() function | Python numpy.mask_indices() function return the indices to access (n, n) arrays, given a masking function. Syntax : numpy.mask_indices(n, mask_func, k = 0) Parameters : n : [int] The returned indices will be valid to access arrays of shape (n, n). mask_func : [callable] A function whose call signature is s 1 min read numpy matrix operations | identity() function numpy.matlib.identity() is another function for doing matrix operations in numpy. It returns a square identity matrix of given input size. Syntax : numpy.matlib.identity(n, dtype=None) Parameters : n : [int] Number of rows and columns in the output matrix. dtype : [optional] Desired output data-type 1 min read numpy matrix operations | eye() function numpy.matlib.eye() is another function for doing matrix operations in numpy. It returns a matrix with ones on the diagonal and zeros elsewhere. Syntax : numpy.matlib.eye(n, M=None, k=0, dtype='float', order='C') Parameters : n : [int] Number of rows in the output matrix. M : [int, optional] Number o 2 min read Like