Skip to content

Instantly share code, notes, and snippets.

@crispg72
Last active October 16, 2017 19:20
Show Gist options
  • Save crispg72/20706fd7c047d9624fa44d70792083a4 to your computer and use it in GitHub Desktop.
Save crispg72/20706fd7c047d9624fa44d70792083a4 to your computer and use it in GitHub Desktop.

Source csv:

,District,Zone,Ecological Belt,Development Region,Year (BS),Year (AD),Country,Gender,Value
0,Achham,Seti,Hill,Far-Western,2068/69,2011/12,Nepal,Male,119923
1,Achham,Seti,Hill,Far-Western,2068/69,2011/12,India,Male,77
2,Achham,Seti,Hill,Far-Western,2068/69,2011/12,China,Male,1
3,Achham,Seti,Hill,Far-Western,2068/69,2011/12,Others,Male,7
4,Achham,Seti,Hill,Far-Western,2068/69,2011/12,Nepal,Female,137419
5,Achham,Seti,Hill,Far-Western,2068/69,2011/12,India,Female,27
6,Achham,Seti,Hill,Far-Western,2068/69,2011/12,China,Female,2
7,Achham,Seti,Hill,Far-Western,2068/69,2011/12,Others,Female,21
...

After mapping geo_code + extracting rows:

geo_level,geo_code,country,gender,total
district,68,Nepal,Male,119923
district,68,India,Male,77
district,68,China,Male,1
district,68,Others,Male,7
district,68,Nepal,Female,137419
district,68,India,Female,27
district,68,China,Female,2
district,68,Others,Female,21
....etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment