Flatting

np.ravel method is used for flatting arrays. Flatting starts from last dimension. For example, array of shape (2, 3, 4) will start with dimension then move to next last and so on.

a = np.array([1, 2, 3](1,%202,%203))
a.ravel()
# array([1, 2, 3, 4, 5, 6])

Note

It returns view of the original array.