numpy.fliplr(array):沿left-right方向的翻转数组(每列中的条目),保留形状
参数:
array : [array_like]Input array, we want to flip
返回:
Flipped array in left-right direction.
# Python Program illustrating
# numpy.fliplr() method
import numpy as geek
array = geek.arange(8).reshape((2,2,2))
print("Original array : \n", array)
# fliplr : means flip left-right
print("\nFlipped array left-right : \n", geek.fliplr(array))
输出:
Original array : [[[0 1] [2 3]] [[4 5] [6 7]]] Flipped array left-right : [[[2 3] [0 1]] [[6 7] [4 5]]]
参考文献:
https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.fliplr.html#numpy.fliplr
相关用法
注:本文由纯净天空筛选整理自 numpy.fliplr() in Python。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。