My dataframe looks like this after converting categorical to numerical using get_dummies()
score1 score2 country_CN country _AU category_leader category_
0.89. 0.45. 0. 1. 0 1
0.55. 0.54 1. 0 1 0
As you can see the converted categorical to numerical columns are country_CN country _AU category_leader category_
I want to bring it to its's original dataframe something like this:
score1 score2 country category_leader
0.89. 0.45. AU
0.55. 0.54 CN leader
I have tried using the suggestion listed here: Reverse a get_dummies encoding in pandas
But no luck as of yet.
Any help/ clue?