I'm using python pandas data frame , I have an initial data frame say X from which I extracted two data frames:
A = X[X.label == k]
B = X[X.label != k]
And then changed the label in A and B:
A.label = 1
B.label = -1
Now I want to combine A and B, such that when we sample A and B from X, they retain their indexes from X.