I take an array with several rows:
import numpy as np
a = np.arange(1, 7)
a = a.reshape(2, -1)
print (a)
[[1 2 3]
[4 5 6]]
I need to access first element of the next row after the last element of the current row:
print (a[0][2:4])
[3]
I expect here:
[3 4]
I also need to access first element of the first row after the last element of the last row:
print (a[1][2:4])
[6]
I expect here:
[6 1]
Could you recommend me the easiest way to achieve this?