I have an array A with shape (N,). I am taking N=5 for illustration:
A = np.array([0,1,1,0,1])
And I want to transform it to one of the follo