Suppose there are a few variables that all share the same value, and the variable df_train
points to that value.
Now if I reassign df_train
to some other frame, all the other variables that pointed at the same object as df_train are now pointing at the old value:
mydata = [df_train, df_test]
df_train = pd.concat( ... )
# now the mydata is no longer sharing the same value as df_train
Is it possible to reassign a dataframe in-place? something like:
mydata = [df_train, df_test]
df_train.set(pd.concat(...))
# now mydata still shares state with df_train