Goal: Create new column that outputs strings based on value in original column
Below is my data frame table. I want to create the new column highlighted in yellow.
Below is my business logic:
1. If value in 'Cat_Priority_1' = 'Cat_1' then the new column ('Cat_Priority_1_Rationale') is equal to the string values in 'Age_Flag', 'Salary_Flag', and 'Education_Flag' columns.
2. If value in 'Cat_Priority_1' = 'Cat_3' then the new column ('Cat_Priority_1_Rationale') is equal to the string values in 'Race_Flag'
This is the code I tried, but it didn't work:
Any help greatly appreciated!
Aucun commentaire:
Enregistrer un commentaire