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

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -