NumPy | Python Methods and Functions

Using the ` `

method we can transpose any matrix that has dimension one or more. ** Numpy numpy.matrix.T () **

Syntax:`numpy.matrix.T()`

Return:Return transpose of every matrix

** Example # 1: **

In this example, we see that using the ` matrix.T () method `

we can transform any matrix type.

` ` |

** Output: **

[[1] [2] [3] [4]]

** Example # 2: **

` `

` ` ` # import important module in python `

` import `

` numpy as np `

` # make a matrix with NumPy `

` gfg `

` = `

` np.matrix (`

` `[1, 2, 3; 4, 5, 6; 7, 8, 9] ``

`) `

` `

` # using the matrix.T () method `

` geeks `

` = `` gfg.getT () `

` `

` print `

` (geeks) `

` `

** Exit:**

[[1 4 7] [2 5 8] [3 6 9]]

Big data is, admittedly, an overhyped buzzword used by software and hardware companies to boost their sales. Behind the hype, however, there is a real and extremely important technology trend with imp...

10/07/2020

The role of adaptation, learning and optimization are becoming increasingly essen- tial and intertwined. The capability of a system to adapt either through modification of its physiological structure ...

10/07/2020

Python for Programmers: with Big Data and Artificial Intelligence Case Studies This book, written for programmers with a high-level experience in another language, uses how-to instructions to teach...

08/08/2021

Scientific progress has increasingly become reliant on large-scale data collection and analysis methodologies. The same is true for the advanced use of computing in business, government, and other are...

10/07/2020

X
# Submit new EBook