9951 explained code solutions for 126 technologies


python-numpyHow to reverse Numpy array


import numpy as np
a = np.array([1, 2, 3, 4, 5])

flipped = np.flip(a)ctrl + c
import numpy as np

load Numpy module for Python

np.array

declare Numpy array

np.flip

reverse specified array

flipped

will contain reversed a array