I have an a array of values
a = np.array([0,3,4,5,12,3,78,53,52])
I would like to move the last three elements in the array starting from the index 3 in order to have
a
array([ 0, 3, 4, 78, 53, 52, 5, 12, 3])
You can use slicing and concatenation.
np.concatenate((a[:3], a[-3:], a[3:-3]))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With