Python | Numpy matrix.round() Last Updated : 23 Apr, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of Numpy matrix.round() method, we are able to round off the values of the given matrix. Syntax : matrix.round() Return : Return rounded values in matrix Example #1 : In the given example we are able to round off the given matrix by using matrix.round() method. Python3 1=1 # import the important module in python import numpy as np # make matrix with numpy gfg = np.matrix('[6.4, 1.3; 12.7, 32.3]') # applying matrix.round() method geeks = gfg.round() print(geeks) Output: [[ 6. 1.] [ 13. 32.]] Example #2 : Python3 1=1 # import the important module in python import numpy as np # make a matrix with numpy gfg = np.matrix('[1.2, 2.3; 4.7, 5.5; 7.2, 8.9]') # applying matrix.round() method geeks = gfg.round() print(geeks) Output: [[ 1. 2.] [ 5. 6.] [ 7. 9.]] Comment More infoAdvertise with us Next Article numpy.trunc() in Python J jitender_1998 Follow Improve Article Tags : Python Python-numpy Python numpy-Matrix Function Practice Tags : python Similar Reads numpy.round_() in Python The round_() function in NumPy rounds the elements of an array to a specified number of decimal places. This function is extremely useful when working with floating-point numbers and when precision is important in scientific computing or data analysis.Syntax: numpy.round_(arr, decimals=0, out=None)P 3 min read Python | Numpy matrix.resize() With the help of Numpy matrix.resize() method, we are able to resize the shape of the given matrix. Remember all elements should be covered after resizing the given matrix. Syntax : matrix.resize(shape) Return: new resized matrix Example #1 : In the given example we are able to resize the given matr 1 min read numpy.trunc() in Python The numpy.trunc() is a mathematical function that returns the truncated value of the elements of array. The trunc of the scalar x is the nearest integer i which, closer to zero than x. This simply means that, the fractional part of the signed number x is discarded by this function. Syntax : numpy.tr 2 min read numpy.rint() in Python The numpy.rint() is a mathematical function that rounds elements of the array to the nearest integer. Syntax : numpy.rint(x[, out]) = ufunc ârintâ) Parameters : array : [array_like] Input array. Return : An array with all array elements being rounded off, having same type and shape as input. Code #1 2 min read Python | Numpy MaskedArray.__rmod__ numpy.ma.MaskedArray class is a subclass of ndarray designed to manipulate numerical arrays with missing data. With the help of Numpy MaskedArray.__rmod__ every element in masked array is operated on binary operator i.e mod(%). Remember we can use any type of values in an array and value for mod is 1 min read Python | Numpy numpy.matrix.A() With the help of Numpy numpy.matrix.A() method, we can get the same matrix as self. It means through this method we can get the identical matrix. Syntax : numpy.matrix.A() Return : Return self matrix Example #1 : In this example we can see that with the help of matrix.A() method, we are able to get 1 min read Like