I am working on the Olympics dataset related to this
This is what the dataframe looks like:
Unnamed: 0 # Summer 01 ! 02 ! 03 ! Total # Winter \
0 Afghanistan (AFG) 13 0 0 2 2 0
1 Algeria (ALG) 12 5 2 8 15 3
2 Argentina (ARG) 23 18 24 28 70 18
3 Armenia (ARM) 5 1 2 9 12 6
4 Australasia (ANZ) [ANZ] 2 3 4 5 12 0
I want to do the following things:
- Split country name and country code and add country name as data frame index
- Remove extra unnecessary characters from country name.
For example the updated column should be:
Unnamed: 0 # Summer 01 ! 02 ! 03 ! Total # Winter \
0 Afghanistan 13 0 0 2 2 0
1 Algeria 12 5 2 8 15 3
2 Argentina 23 18 24 28 70 18
3 Armenia 5 1 2 9 12 6
4 Australasia 2 3 4 5 12 0
Please show me a proper way to achieve this.