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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -