Reputation: 16395
Pandas Dataframes are suposed to be mutable, like lists. Therefore a change in the dataframe should be reflected in the previous reference.
However:
df.drop(to_delete)
Does not delete the indexes in the variable to delete.
df=df.drop(to_delete)
You have to reassign the variable. Why is that? Is the new the df than the same instance of the object?
Upvotes: 1
Views: 406