Skip to content

Commit 60cf5df

Browse files
authored
Merge pull request numpy#26628 from luxedo/DOC/21351/matrix_transpose
DOC: add `matrix_transpose` example
2 parents 075b207 + cc55d18 commit 60cf5df

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

numpy/_core/fromnumeric.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,19 @@ def matrix_transpose(x, /):
722722
--------
723723
transpose : Generic transpose method.
724724
725+
Examples
726+
--------
727+
>>> np.matrix_transpose([[1, 2], [3, 4]])
728+
array([[1, 3],
729+
[2, 4]])
730+
731+
>>> np.matrix_transpose([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])
732+
array([[[1, 3],
733+
[2, 4]],
734+
735+
[[5, 7],
736+
[6, 8]]])
737+
725738
"""
726739
x = asanyarray(x)
727740
if x.ndim < 2:

0 commit comments

Comments
 (0)