I have a dataframe df. Now, I took a backup of this df using:
df_backup = df
Later on in my code, I deleted few records from the original df using:
df.drop(df.index[indexes], inplace = True)
these rows gets deleted from the backup as well.
It looks like df_backup
is just a copy of df
. How do I decouple both?
If I change anything to df
, it shouldn't affect df_backup
.