numpy.fliplr
Flip array in the left/right direction.
ValueError: Input must be >= 2-d.
https://ideone.com/xd3w1U (Python 3.5)
import numpy as np
xs = [[3, 1, 4], [1, 5, 9]]
res = np.fliplr(xs)
print(res)
xs = [3, 1, 4]
res = np.fliplr(xs)
print(res)
run
[[4 1 3]
[9 5 1]]
stderr
Traceback (most recent call last):
File "./prog.py", line 4, in <module>
File "/usr/lib/python3/dist-packages/numpy/lib/twodim_base.py", line 81, in fliplr
raise ValueError("Input must be >= 2-d.")
ValueError: Input must be >= 2-d.
エラーの詳細
153行あたり
if m.ndim < 2:
raise ValueError, "Input must >= 2-d."
このエラーが出ているようだ。