Skip to content

TRANSPOSE_MATRIX

Download Flojoy Studio to try this app
Take an input 2D matrix and transpose it. Params: a : Matrix The input matrix to be transposed Returns: out : Matrix The transposed matrix
Python Code
from numpy import transpose
from flojoy import flojoy, Matrix


@flojoy
def TRANSPOSE_MATRIX(default: Matrix) -> Matrix:
    """Take an input 2D matrix and transpose it.

    Parameters
    ----------
    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 App

Having problems 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.