Python | Numpy matrix.round() Last Updated : 23 Apr, 2019 Comments Improve Suggest changes 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 Python | Numpy matrix.round() 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.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.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 Like