I'm using python pandas data frame , I have a initial data frame say D. I extract two data frames from it like this:
A = D[D.label == k]
B = D[D.label != k]
then I change the label in A and B:
A.label = 1
B.label = -1
I want to combine A and B so I can have them as one data frame something like union. The order of the data not important , however when we sample A and B from D they retain their indexes from D.