I have a dataframe like this:
office school hospital garage lab occupation
blah
blahblah
sometext
Basically I want to end up with just the occupation column completed by looping through each row and printing the free-text into that column depending on whichever column is completed. Only one of the columns (office, school, hospital, garage and lab) are populated per row. Here's how the above example should look in the end:
office school hospital garage lab occupation
blah blah
blahblah blahblah
sometext sometext
I am aware of the np.where() method but I don't think this can look at this many columns (which is why I put more than 2 columns in the title).
Thanks!