diff options
author | Shreya <shreyas1696@gmail.com> | 2022-09-16 18:21:43 +0000 |
---|---|---|
committer | melissawm <melissawm.github@gmail.com> | 2022-09-16 16:54:57 -0300 |
commit | b99935e362e1fb52a4d12e678cb509c45b666cfb (patch) | |
tree | 61fd7ca5d08cef052f1281028596820936d26ead /numpy/lib/function_base.py | |
parent | 5f94eb858f3e181eccfda2c26db9f0b9167a8156 (diff) | |
download | numpy-b99935e362e1fb52a4d12e678cb509c45b666cfb.tar.gz |
DOC: Add examples to msort in lib/function_base.py
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 15e24a0d9..9d59d79de 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -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) |