python - Reordering numpy array -
i have following numpy array:
arr = np.array([0.3, 3.5, 12.0, 2.9, 11.0, 23.0])
i want reorder array starts @ 4th position, followed items after start position in order, followed items before start position. i.e.
[2.9, 11.0, 23.0, 0.3, 3.5, 12.0]
how can without loop?
try
np.roll(arr, -3)
negative since want "move" elements left
Comments
Post a Comment