I need to combine 2 numpy arrays (same lenght) into a large array and then decouple the array back to original. I know how to combine the array but not sure how to decouple it.
So, combining array
x=np.random.randint(5, size=(100000, 3))
y=np.random.randint(5, size=(100000, 1))
a=np.hstack((x,y))
now, I am not sure how to get x and y back again. I have tried
(_x,_y)=a.shape
_x=-_x
nx=a[:,0]
ny=a[:,_x:,]
And forwhatever reason, I am not getting my correct, x and y.
Is there a better way to do this?
numpy.hsplitis the reverse ofnumpy.hstack