numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
flipud(m)

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.

Notes

Equivalent to m[::-1, ...] or np.flip(m, axis=0) . Requires the array to be at least 1-D.

Parameters

m : array_like

Input array.

Returns

out : array_like

A view of m with the rows reversed. Since a view is returned, this operation is $\mathcal O(1)$ .

Reverse the order of elements along axis 0 (up/down).

See Also

flip

Flip array in one or more dimensions.

fliplr

Flip array in the left/right direction.

rot90

Rotate array counterclockwise.

Examples

>>> A = np.diag([1.0, 2, 3])
... A array([[1., 0., 0.], [0., 2., 0.], [0., 0., 3.]])
>>> np.flipud(A)
array([[0.,  0.,  3.],
       [0.,  2.,  0.],
       [1.,  0.,  0.]])
>>> A = np.random.randn(2,3,5)
... np.all(np.flipud(A) == A[::-1,...]) True
>>> np.flipud([1,2])
array([2, 1])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.fliplr dask.array.routines.flipud numpy.diagonal numpy.flip dask.array.creation.diagonal numpy.rot90 numpy.fill_diagonal

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/twodim_base.py#101
type: <class 'function'>
Commit: