0

I have a series of employee ID's and a dataframe that uses employee id's. I would like to delete all the rows from the dataframe that have corresponding employee id's in the Series

I have this code which provides the Series

resigned = employee_change['employee_id'][employee_change['type_of_termination'] == 'resignation']

I then have a dataframe called change_employee and would like to remove all rows of change_employee that has an employee_id in the series resigned

Loyal_Burrito
  • 125
  • 2
  • 14

1 Answers1

1
change_employee = change_employee.loc[~change_employee['employee_id'].isin(resigned)]
Michael
  • 5,095
  • 2
  • 13
  • 35
  • 1
    couple of notes: I would use `.loc` accessor instead of bare brackets and you don't need the `.tolist` at the end – Paul H Jun 11 '19 at 15:55