numpy.flip(array, axis) : Reverses the order of array elements along the specified axis, preserving the shape of array.
array : [array_like]Array to be input axis : [integer]axis along which array is reversed.
reversed array with shape preserved
Original array : [[[0 1] [2 3]] [[4 5] [6 7]]] Flipped array : [[[4, 5] [6, 7]] [[0, 1] [2, 3]]]
These codes won’t run on online-ID. Please run them on your systems to explore the working
This article is contributed by Mohit Gupta_OMG 😀. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Python - Read blob object in python using wand library
- Python | Convert list to Python array
- Python | Index of Non-Zero elements in Python list
- Important differences between Python 2.x and Python 3.x with examples
- Reading Python File-Like Objects from C | Python
- Python | Merge Python key values to list
- Python | PRAW - Python Reddit API Wrapper
- MySQL-Connector-Python module in Python
- twitter-text-python (ttp) module - Python
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
- Python | Add Logging to Python Libraries
- Python | Add Logging to a Python Script
- Python | Visualizing O(n) using Python
- abs() in Python
- Python | a += b is not always a = a + b
- bin() in Python
- Use of min() and max() in Python
- max() and min() in Python