A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://numpy.org/doc/stable/reference/generated/numpy.matrix_transpose.html below:

numpy.matrix_transpose — NumPy v2.3 Manual

numpy.matrix_transpose#
numpy.matrix_transpose(x, /)[source]#

Transposes a matrix (or a stack of matrices) x.

This function is Array API compatible.

Parameters:
xarray_like

Input array having shape (…, M, N) and whose two innermost dimensions form MxN matrices.

Returns:
outndarray

An array containing the transpose for each matrix and having shape (…, N, M).

Examples

>>> import numpy as np
>>> np.matrix_transpose([[1, 2], [3, 4]])
array([[1, 3],
       [2, 4]])
>>> np.matrix_transpose([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])
array([[[1, 3],
        [2, 4]],
       [[5, 7],
        [6, 8]]])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4