Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a44c838

Browse files
authored
Merge pull request #22279 from shreya-singh-tech/shreya
DOC: Add example to msort docstring
2 parents d71275f + 1cefcb9 commit a44c838

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

numpy/lib/function_base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3666,6 +3666,13 @@ def msort(a):
36663666
-----
36673667
``np.msort(a)`` is equivalent to ``np.sort(a, axis=0)``.
36683668
3669+
Examples
3670+
--------
3671+
>>> a = np.array([[1, 4], [3, 1]])
3672+
>>> np.msort(a) # sort along the first axis
3673+
array([[1, 1],
3674+
[3, 4]])
3675+
36693676
"""
36703677
b = array(a, subok=True, copy=True)
36713678
b.sort(0)

0 commit comments

Comments
 (0)