transpose

x'

transpose(x)

Try it yourself:


transpose(): swap matrix rows and columns

transpose(A) turns rows into columns. A matrix with shape m×n becomes n×m.

Example

The transpose of [[1,2,3],[4,5,6]] is [[1,4],[2,5],[3,6]]. It is central to dot products, covariance, and matrix factorization.

Related functions

Use multiply() for matrix products, trace() for diagonal sums, inv() for inverses, and svd() for decomposition. size() verifies the changed shape.

Caveat

Transpose does not conjugate complex entries; use a conjugate-transpose operation when that is required.

Try Transpose in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions