Rotate-matrix module in Python Last Updated : 02 Nov, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The rotate-matrix is an interesting new python module, which allows conversion of a matrix(2-D array) into either clockwise rotation or anti-clockwise rotation. It at present consists of only two methods. You can loop through these methods for 'n' number of rotations. Installation This module doesn't come in-built with python but can be installed using the following command: pip install rotate-matrix Functions 1) clockwise(): As obviously the name suggests, this function is used to rotate the matrix clockwise. Syntax: clockwise(matrix) Parameter: Takes matrix as parameter which is of type list. Return Value: passes the clock-wised rotated version of the matrix Example: Python3 import rotate_matrix mat = [[5, 2, 6], [8, 2, 9], [3, 6, 7], [3, 6, 2]] print(rotate_matrix.clockwise(mat)) Output: [(6, 9, 7, 2), (2, 2, 6, 6), (5, 8, 3, 3)] 2) anti_clockwise(): This function of this module rotates the given matrix anti-clockwise. Syntax: anti_clockwise(matrix) Parameter: Takes matrix as parameter which is of type list Return Value: passes the anti-clockwise rotated version of the matrix Example: Python3 import rotate_matrix mat = [[5, 2, 6], [8, 2, 9], [3, 6, 7], [3, 6, 2]] print(rotate_matrix.anti_clockwise(mat)) Output: [(3, 3, 8, 5), (6, 6, 2, 2), (2, 7, 9, 6)] Comment More infoAdvertise with us Next Article Python | Numpy matrix.reshape() U uddipta2255 Follow Improve Article Tags : Python python-modules Practice Tags : python Similar Reads AlgebraOnMatrix Module in Python AlgebraOnMatrix module is that library of python which helps you to perform basic matrix algebra such as addition of two matrices, subtraction of two matrices, multiplication of two matrices, transpose of matrix . Installing Library This module does not come built-in with Python. You need to install 3 min read Python | Numpy matrix.reshape() With the help of Numpy matrix.reshape() method, we are able to reshape the shape of the given matrix. Remember all elements should be covered after reshaping the given matrix. Syntax : matrix.reshape(shape) Return: new reshaped matrix Example #1 : In the given example we are able to reshape the give 1 min read Matrix Transpose Without Numpy In Python Matrix transpose is a fundamental operation in linear algebra where the rows of a matrix are swapped with its columns. This operation is denoted by A^T, where A is the original matrix. The transposition of a matrix has various applications, such as solving systems of linear equations, computing the 3 min read Python | Numpy matrix.transpose() With the help of Numpy matrix.transpose() method, we can find the transpose of the matrix by using the matrix.transpose()method in Python. Numpy matrix.transpose() Syntax Syntax : matrix.transpose() Parameter: No parameters; transposes the matrix it is called on. Return : Return transposed matrix Wh 3 min read How to rotate text in Matplotlib â Python In this article, we will learn how to rotate text in Matplotlib in Python. Out of the many parameters in matplotlib.text(), there are three main parameters that will define text rotation and how the text will be rotated. Syntax of matplotlib.text method Syntax: matplotlib.text(x=0, y=0, text='', rot 2 min read Python | sympy.Matrix() method With the help of sympy.Matrix() method, we can make, rearrange, extract the different rows and columns in a matrix which is created by sympy.Matrix() method. Syntax : sympy.Matrix() Return : Return a matrix.  Example #1 :In this example, we can see that by using sympy.Matrix() method, we can create 1 min read Like