I have a dataframe that looks like below:
|userid|rank2017|rank2018|
|212 |'H' |'H' |
|322 |'L' |'H |
|311 |'H' |'L' |
I want to create a new column called progress in the the dataframe above that will output 1 if rank2017 is equal to rank2018, 2 if rank2017 is 'H' and rank2018 is 'L' else 3. can anybody help me execute this in python