I have a initial dataframe D
. I extract two data frames from it like this:
A = D[D.label == k]
B = D[D.label != k]
I want to combine A
and B
into one DataFrame. The order of the data is not important. However, when we sample A
and B
from D
, they retain their indexes from D
.
pandas v1.4.1
: Theframe.append
method is deprecated and will be removed from pandas in a future version. Usepandas.concat
instead.