TRANSPOSE_MATRIX
The TRANSPOSE_MATRIX node takes an input 2D matrix and transposes it.Params:a : MatrixThe input matrix to be transposedReturns: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.
Parameters
----------
a : Matrix
The input matrix to be transposed
Returns
-------
Matrix
The transposed matrix
"""
return Matrix(m=transpose(default.m, (1, 0)))
Example
Having problem with this example app? Join our Discord community and we will help you out!
This example shows the function of the TRANSPOSE_MATRIX
node. This node transposes the input matrix by switching columns to rows and visa versa.