Relative Content

Tag Archive for pythonpandas

Delete indexed observation based on other column entry

I have an example imported excel spreadsheet that appears like this with many more entries and i read in with pd.read_excel. I would like to delete all of ID 3’s entries since the status is deleted and I would like to remove the whole index 7 since the region is not set. I started off by setting a mulit index with df = df.set_index(['id']), I then performed this df.set_index('id')[['status']].eq('deleted').groupby(level=0).all()
and got the True/False value results with an extra false in the row above the first entry. Unsure how to perform the delete row if region mission.

Delete indexed observation based on other column entry

I have an example imported excel spreadsheet that appears like this with many more entries and i read in with pd.read_excel. I would like to delete all of ID 3’s entries since the status is deleted and I would like to remove the whole index 7 since the region is not set. I started off by setting a mulit index with df = df.set_index(['id']), I then performed this df.set_index('id')[['status']].eq('deleted').groupby(level=0).all()
and got the True/False value results with an extra false in the row above the first entry. Unsure how to perform the delete row if region mission.