Skip to content

Commit

Permalink
DOC: Add examples to msort in lib/function_base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shreya-singh-tech authored and melissawm committed Sep 16, 2022
1 parent 5f94eb8 commit b99935e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions numpy/lib/function_base.py
Expand Up @@ -3666,6 +3666,14 @@ def msort(a):
-----
``np.msort(a)`` is equivalent to ``np.sort(a, axis=0)``.
Examples
--------
>>> a = np.array([[1,4],[3,1]])
>>> np.msort(a) # sort along the first axis
array([[1, 1],
[3, 4]])
"""
b = array(a, subok=True, copy=True)
b.sort(0)
Expand Down

0 comments on commit b99935e

Please sign in to comment.