summaryrefslogtreecommitdiff
path: root/numpy/lib/twodim_base.py
diff options
context:
space:
mode:
authorTim Hoffmann <2836374+timhoffm@users.noreply.github.com>2021-03-09 16:52:31 +0100
committerTim Hoffmann <2836374+timhoffm@users.noreply.github.com>2021-03-09 16:54:25 +0100
commitada38d2229f87823fd3b2a9d8ed104c3c22bbf4e (patch)
tree7ed0c6526cc77339856f5b828cda9db229f7097b /numpy/lib/twodim_base.py
parent2ea7ebdc4294868ec982ad6310d0daf6477fabfc (diff)
downloadnumpy-ada38d2229f87823fd3b2a9d8ed104c3c22bbf4e.tar.gz
DOC: Clarify docs for fliplr() / flipud()
Diffstat (limited to 'numpy/lib/twodim_base.py')
-rw-r--r--numpy/lib/twodim_base.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
index afd50b9c6..58a097f99 100644
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -47,10 +47,11 @@ def _flip_dispatcher(m):
@array_function_dispatch(_flip_dispatcher)
def fliplr(m):
"""
- Flip array in the left/right direction.
+ Reverse the order of elements along axis 1 (left/right).
- Flip the entries in each row in the left/right direction.
- Columns are preserved, but appear in a different order than before.
+ For a 2-D array, this flips the entries in each row in the left/right
+ direction. Columns are preserved, but appear in a different order than
+ before.
Parameters
----------
@@ -66,11 +67,13 @@ def fliplr(m):
See Also
--------
flipud : Flip array in the up/down direction.
+ flip : Flip array in one or more dimesions.
rot90 : Rotate array counterclockwise.
Notes
-----
- Equivalent to m[:,::-1]. Requires the array to be at least 2-D.
+ Equivalent to ``m[:,::-1]`` or ``np.flip(m, axis=1)``.
+ Requires the array to be at least 2-D.
Examples
--------
@@ -98,10 +101,10 @@ def fliplr(m):
@array_function_dispatch(_flip_dispatcher)
def flipud(m):
"""
- Flip array in the up/down direction.
+ Reverse the order of elements along axis 0 (up/down).
- Flip the entries in each column in the up/down direction.
- Rows are preserved, but appear in a different order than before.
+ For a 2-D array, this flips the entries in each column in the up/down
+ direction. Rows are preserved, but appear in a different order than before.
Parameters
----------
@@ -117,12 +120,13 @@ def flipud(m):
See Also
--------
fliplr : Flip array in the left/right direction.
+ flip : Flip array in one or more dimesions.
rot90 : Rotate array counterclockwise.
Notes
-----
- Equivalent to ``m[::-1,...]``.
- Does not require the array to be two-dimensional.
+ Equivalent to ``m[::-1, ...]`` or ``np.flip(m, axis=0)``.
+ Requires the array to be at least 1-D.
Examples
--------