Considering I also have another columns beside these columns below, I want to create a new column by these 3 columns that define the final status of each rows.
status_1 status_2 status_3
a_accepted_with_comment a_revised c_approved
a_accepted_with_comment c_rejected nan
a_rejected a_approved nan
a_rejected nan nan
From the 3 column, if the last column which has value shows c_approved then the new column will give approved
From the 3 column, if the last column which has value shows c_rejected then the new column will give rejected
From the 3 column, if the last column that has value shows a_approved then the new column will give revised
From the 3 column, if the last column that has value shows a_rejected then the new column will give rejected
The final table would be like:
status_1 status_2 status_3 final_status
a_accepted_with _comment a_revised c_approved approved
a_accepted_with_comment c_rejected nan rejected
b_rejected a_approved nan revised
a_rejected nan nan rejected
How can I make this new column with such multiple condition in python?
Thanks in advance.