My aim is to rotate a 1d numpy array by left.For example desired output for numpy array [1,2,3,4] should be [2,3,4,1].
Here is my approach:
import numpy as np
x = np.array([1,2,3,4])
x1 = x[1:]
x2 = x[:1]
print(np.concatenate(x1,x2))
I am facing an error while concatenating. Why is that?
I tried this approach also:
lst = x[1:] + x[:1]
print(np.array(lst))
Although I am getting the desired output I am also getting a error
DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
np.concatenate([x1,x2])