I have to create multiple new columns based on a single condition. I have a code that has multiple lines, is there a way to shorten or optimize the below code, since I have to repeat it numerous times:
LOOKUP['Publisher']= np.where(LOOKUP['Subchannel'].str.contains("PROMO"),"Instagram",LOOKUP['Publisher'])
LOOKUP['Channel']= np.where(LOOKUP['Subchannel'].str.contains("PROMO"),"Social",LOOKUP['Channel'])
LOOKUP['Source']= np.where(LOOKUP['Subchannel'].str.contains("PROMO"),"AA",LOOKUP['Source'])
LOOKUPhere, exactly?