Have pandas DF of type:
state x y
0 Alabama 139 -77
1 Alaska -204 -170
2 Arizona -203 -40
etc.
I have a list of state names which I need to remove from this DF. I try to use loop for it, but it does not work and the DF is the same as before. The state names are what they need to be, so they should be found by my condition.
for state in self.guessed_states:
states_data.drop(states_data[states_data["state"] == state].index, inplace=True)
The output is the same, so nothing changes after this loop. What am I doing wrong here?