0

I have a code snippet that I am struggling with. I have a column called Scope which takes in some criteria to determine if the employee at hand is 'QBHC', 'QBHC Mgr', or Out of Scope if none of the criteria are met. This is my code snippet:

df_personnel_data['Scope'] = np.where(((df_personnel_data['EmployeeStatus'] == 'Active') 
                                       & (df_personnel_data['isQBHC'] == True) 
                                       & (df_personnel_data['GradeLevel'] == 'IC') 
                                       & (df_personnel_data['Has Target'] == 1)), 
                                      'QBHC', np.nan)

df_personnel_data['Scope'] = np.where(((df_personnel_data['EmployeeStatus'] == 'Active') 
                                       & (df_personnel_data['GradeLevel'] != 'IC') 
                                       & (df_personnel_data['Has Target'] == 1) 
                                       & (df_personnel_data['Scope'] != 'QBHC')), 
                                      'QBHC Mgr', 'Out of Scope')

The first block will work when I comment out the second block, and vice versa. I would appreciate any help anyone would have on this issue or if there should be a better way to approach this. Thank you!

ALollz
  • 57,915
  • 7
  • 66
  • 89
ek11222
  • 59
  • 4

0 Answers0