I thought that working on a copy of a pandas df didn't change the original df... However, in this example, it does:
test = pd.DataFrame({"first": [[1,2,3], [4,2,5], [6,2,7]]})
a = test.copy()
s = a.sample()
s = s["first"].iloc[0]
s.remove(2)
When I now print test again, it has changed. Why does this happen and how can I prevent it?