matrix_transpose

sparse.matrix_transpose(x, /)[source]

Transposes a matrix or a stack of matrices.

Parameters:

x (SparseArray) – Input array.

Returns:

out – Transposed COO array.

Return type:

COO

Raises:

ValueError – If the input array isn’t and can’t be converted to COO format, or if x.ndim < 2.