I have two pandas DataFrames, sdm. I wanted to create a copy of that DataFrame and work on that and later, I want to create another copy from sdm and work on different analysis. However, when I create a new Data Frame like this,
new_df = sdm
It creates a copy, however, when I alter new_df, it makes changes to the my old DataFrame sdm. How can I handle this without using =?
sdm.copy()deep=True.=does not work as it is inR?=isn't a trick. It's an assignment. It assigns the right hand side to the variable on the left hand side.