Reputation: 21280
I have following DataFrame:
voting_result project scene
Bad ccus 345943
Good ccus 311129
Bad ccus 309082
Bad ccus 331613
Good ccus 331615
Not Sure ccus 331616
What is Pandas
way to encode
voting_result column to integers by following rule {'Bad':0, 'Good':1, 'Not Sure':2
} and to get following resut
voting_result project scene
0 ccus 345943
1 ccus 311129
0 ccus 309082
0 ccus 331613
1 ccus 331615
2 ccus 331616
Thanks
Upvotes: 1
Views: 65