Transpose

A transpose of the matrix Am×nA_{m \times n} is another matrix, An×mTA^T_{n \times m} such that i\forall i, the ithi^{th} row of AA becomes the ithi^{th} column of ATA^T.

Example

A=[123562],AT=[152632]A=\begin{bmatrix}1&2&3\\5&6&2\end{bmatrix} , A^T=\begin{bmatrix}1&5\\2&6\\3&2\end{bmatrix}

Note: The transpose of a symmetric matrix is the same matrix.

Transpose in NumPy

We can use .T to take the transpose of matrices in NumPy. The following code illustrates its use.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy