logo

numpy.fliplr() in Python

numpy.fliplr(array) : Draai de array (items in elke kolom) in de vorm van links naar rechts behouden Parameters:
array : [array_like]Input array we want to flip 
Opbrengst :
Flipped array in left-right direction. 
Python
# Python Program illustrating # numpy.fliplr() method import numpy as geek array = geek.arange(8).reshape((222)) print('Original array : n' array) # fliplr : means flip left-right print('nFlipped array left-right : n' geek.fliplr(array)) 
Uitgang:
Original array : [[[0 1] [2 3]] [[4 5] [6 7]]] Flipped array left-right : [[[2 3] [0 1]] [[6 7] [4 5]]] 
Opmerking : Deze codes werken niet op online IDE's. Voer ze uit op uw systemen om de werking te verkennen. Quiz maken