Skip to content

Commit cc55d18

Browse files
committed
DOC: add matrix_transpose example
1 parent 7f6ac72 commit cc55d18

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)