Skip to content

TRANSPOSE_MATRIX

The TRANSPOSE_MATRIX node takes an input 2D matrix and transposes it.Inputs ------ a : Matrix The input matrix to be transposedParams:Returns:out : MatrixThe transposed matrix
Python Code
from numpy import transpose
from flojoy import flojoy, Matrix


@flojoy
def TRANSPOSE_MATRIX(default: Matrix) -> Matrix:
    """The TRANSPOSE_MATRIX node takes an input 2D matrix and transposes it.

    Inputs
    ------
    a : Matrix
        The input matrix to be transposed

    Returns
    -------
    Matrix
        The transposed matrix
    """

    return Matrix(m=transpose(default.m, (1, 0)))

Find this Flojoy Block on GitHub

Example

Having problem with this example app? Join our Discord community and we will help you out!
React Flow mini map

This example shows the function of the TRANSPOSE_MATRIX node. This node transposes the input matrix by switching columns to rows and visa versa.