Set value of a column based on values of other columns (Pandas)
I would use apply. It allows you to perform a function row-wise or column-wise. Check this post on StackOverflow, it provides good examples of what this looks like.

The gist is:


create a function that creates the value you want based on a row
use apply to create a dataframe containing the results
if you're happy with the results, merge that dataframe into your existing one