Here is test code,
testframe = pd.DataFrame({"A":"1","B":"1","C":"1","D":"1"})
dataframe1 = testframe
#try to remove column C
dataframe1.drop(['C'],axis=1,inplace=True)
#then modify col D, like
>>A B D
1 1 2
#rename col 'D' to 'E', now dataframe1 contains only 'A' and 'E'
#(does this mean )
dataframe1.rename(columns={"D": "E"}, inplace=True)
print(dataframe1)
# result is ,
>>A B E
1 1 2
#join two dataframe(is this allowed? it seems that I joined a copy of 'testframe')
testframe = testframe.set_index(['A','B']).join(dataframe1.set_index(['A','B']))
print(testframe)
but the result is
A B C D E
1 1 1 2 2
It looks like joint of two dataframe, but it is not, in fact.
Why is Col D changed?