Trying to incorporate the following case statement in my code.
d1['newcol'] = np.where((d1['business_name'] == 'HELP')&(d1['level'] == 'Component'), d1['component'], np.where((d1['business_name'] == 'HELP')&(d1['level'] == 'Package'),d1['package'], np.where(d1['business_name'] == 'PHELPS',d1['reporting'])))
Or the case pseudocode would look like:
newcol=case WHEN ((business_name = 'HELP' AND level = 'Component')) THEN component WHEN ((business_name = 'HELP' AND level = 'Package')) THEN package WHEN (business_name = 'PHELS') THEN reporting END
the error Im getting is:
ValueError: either both or neither of x and y should be given
any help would be appreciated.