numpy.flip() in Python

numpy.flip() in Python

The numpy.flip() function is used to reverse the order of elements in an array along the given axis where the shape of the array is preserved, but the elements are reordered.

Syntax

Parameter

m : This parameter represents the Input array.

axis : Axis or axes parameter is used to flip over the values. The default axis value is None, flip over all of the axes of the input array

Return

This function returns a view of m with the entries of axis reversed.

Example 1

Output