So I have a pandas data frame consisting of data from boxing matches and their odds of winning. It's columns are:
[Red_fighter, Blue_fighter, Red_odds, Blue_odds, winner]
I want to change it so that if for example, blue's odds are 'less' than red's that blue gets added to column 'Favourite' and red gets added to 'Underdog' both of which replace 'Red_fighter' and 'Blue fighter'
[favourite, underdog, favourite_odds, underdog_odds, winner]
So if I have:
{'Red_fighter' : 'Tom Jones', 'Blue_fighter' : 'Jack Jackson', 'Red_odds' : 200, 'Blue_odds' : -200 , 'Winner' : 'Blue'}
It becomes:
{'Underdog' : 'Tom Jones', 'Favourite' : 'Jack Jackson', 'Red_odds' : 200, 'Blue_odds' : -200 , 'Winner' : 'Favourite'}
I appreciate any help you can give, I'm a newbie to pandas and data analytics in general, thanks!