Task: Transform-by-output-target-schema (source dataset: github-pipelines)

Your task is to create a data transformation pipeline in Python using pandas libraries.

Given Source Tables below, and a Target Schema provided by users that demonstrates how the desired output table should look like schematically, please write Python pandas code that can transform the Source Tables into an output table, that matches the schema/structure given by the Target Schema.  Please note that the data values in the Target Schema are intended to represent the format and layout of the output table, but may not exactly match the actual data generated from the Source Tables when the python code is run on the Source Tables.

Use operations such as merge, groupby, pivot, apply, or any appropriate python or pandas steps. Your code should save the resulting DataFrame to a CSV file named 'output.csv'. Ensure that the code is executable and can be run directly as is, in a Python environment with pandas installed.

Source Tables:


Table #1
Filename: source_0.csv
Sample Rows in Markdown:
| GEO.id         |   GEO.id2 | GEO.display-label   |   HD01_VD01 |   HD02_VD01 |   Year |
|:---------------|----------:|:--------------------|------------:|------------:|-------:|
| 8600000US91932 |     91932 | ZCTA5 91932         |       26801 |         197 |   2016 |
| 8600000US40506 |     40506 | ZCTA5 40506         |        2742 |         359 |   2016 |
| 8600000US78231 |     78231 | ZCTA5 78231         |        8258 |         615 |   2016 |
| 8600000US84315 |     84315 | ZCTA5 84315         |        8409 |         318 |   2016 |
| 8600000US31821 |     31821 | ZCTA5 31821         |         304 |         194 |   2016 |
| 8600000US10577 |     10577 | ZCTA5 10577         |        6508 |         477 |   2016 |
| 8600000US95231 |     95231 | ZCTA5 95231         |        4806 |         616 |   2016 |
| 8600000US68377 |     68377 | ZCTA5 68377         |         414 |          91 |   2016 |
| 8600000US33322 |     33322 | ZCTA5 33322         |       38996 |        1301 |   2016 |
| 8600000US92342 |     92342 | ZCTA5 92342         |        7058 |         948 |   2016 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| GEO.id         |   GEO.id2 | GEO.display-label   |   HD01_VD01 |   HD02_VD01 |   Year |
|:---------------|----------:|:--------------------|------------:|------------:|-------:|
| 8600000US33898 |     33898 | ZCTA5 33898         |       16144 |        1045 |   2015 |
| 8600000US11751 |     11751 | ZCTA5 11751         |       14462 |         712 |   2015 |
| 8600000US37022 |     37022 | ZCTA5 37022         |        5974 |         866 |   2015 |
| 8600000US17501 |     17501 | ZCTA5 17501         |        4226 |         142 |   2015 |
| 8600000US84735 |     84735 | ZCTA5 84735         |         254 |          94 |   2015 |
| 8600000US42301 |     42301 | ZCTA5 42301         |       43243 |        1150 |   2015 |
| 8600000US51650 |     51650 | ZCTA5 51650         |         421 |         107 |   2015 |
| 8600000US68941 |     68941 | ZCTA5 68941         |         734 |          99 |   2015 |
| 8600000US77872 |     77872 | ZCTA5 77872         |        1486 |         333 |   2015 |
| 8600000US83873 |     83873 | ZCTA5 83873         |        1402 |         177 |   2015 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| GEO.id         |   GEO.id2 | GEO.display-label   |   HD01_VD01 |   HD02_VD01 |   Year |
|:---------------|----------:|:--------------------|------------:|------------:|-------:|
| 8600000US80547 |     80547 | ZCTA5 80547         |        1223 |         476 |   2014 |
| 8600000US38544 |     38544 | ZCTA5 38544         |        6463 |         539 |   2014 |
| 8600000US56080 |     56080 | ZCTA5 56080         |         697 |         143 |   2014 |
| 8600000US49744 |     49744 | ZCTA5 49744         |         908 |         178 |   2014 |
| 8600000US34237 |     34237 | ZCTA5 34237         |       17525 |         805 |   2014 |
| 8600000US48047 |     48047 | ZCTA5 48047         |       39681 |         655 |   2014 |
| 8600000US74347 |     74347 | ZCTA5 74347         |        2999 |         345 |   2014 |
| 8600000US13053 |     13053 | ZCTA5 13053         |        4283 |         412 |   2014 |
| 8600000US78404 |     78404 | ZCTA5 78404         |       16371 |        1082 |   2014 |
| 8600000US58202 |     58202 | ZCTA5 58202         |        1894 |         237 |   2014 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| GEO.id         |   GEO.id2 | GEO.display-label   |   HD01_VD01 |   HD02_VD01 |   Year |
|:---------------|----------:|:--------------------|------------:|------------:|-------:|
| 8600000US49738 |     49738 | ZCTA5 49738         |        9962 |         266 |   2012 |
| 8600000US49740 |     49740 | ZCTA5 49740         |        6805 |         266 |   2012 |
| 8600000US49743 |     49743 | ZCTA5 49743         |         786 |         120 |   2012 |
| 8600000US49744 |     49744 | ZCTA5 49744         |         822 |         154 |   2012 |
| 8600000US49745 |     49745 | ZCTA5 49745         |        1264 |         221 |   2012 |
| 8600000US49746 |     49746 | ZCTA5 49746         |        3700 |         236 |   2012 |
| 8600000US49747 |     49747 | ZCTA5 49747         |        1784 |         167 |   2012 |
| 8600000US49748 |     49748 | ZCTA5 49748         |         138 |          36 |   2012 |
| 8600000US49749 |     49749 | ZCTA5 49749         |        4166 |         321 |   2012 |
| 8600000US49751 |     49751 | ZCTA5 49751         |        1747 |         169 |   2012 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| GEO.id         |   GEO.id2 | GEO.display-label   |   HD01_VD01 |   HD02_VD01 |   Year |
|:---------------|----------:|:--------------------|------------:|------------:|-------:|
| 8600000US72006 |     72006 | ZCTA5 72006         |        2530 |         218 |   2013 |
| 8600000US87711 |     87711 | ZCTA5 87711         |         484 |         187 |   2013 |
| 8600000US93223 |     93223 | ZCTA5 93223         |       10695 |         141 |   2013 |
| 8600000US49057 |     49057 | ZCTA5 49057         |        7145 |         325 |   2013 |
| 8600000US46767 |     46767 | ZCTA5 46767         |        8280 |         549 |   2013 |
| 8600000US57785 |     57785 | ZCTA5 57785         |        9276 |         457 |   2013 |
| 8600000US87562 |     87562 | ZCTA5 87562         |         435 |         201 |   2013 |
| 8600000US30621 |     30621 | ZCTA5 30621         |        4882 |         521 |   2013 |
| 8600000US25705 |     25705 | ZCTA5 25705         |       20866 |         882 |   2013 |
| 8600000US30666 |     30666 | ZCTA5 30666         |        9287 |         860 |   2013 |


Target Schema:
| GEO.id         |   GEO.id2 |   GEO.display-label |   HD01_VD01 |   HD02_VD01 |   Year |
|:---------------|----------:|--------------------:|------------:|------------:|-------:|
| 8600000US00601 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00602 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00603 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00606 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00610 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00612 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00616 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00617 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00622 |         5 |                   5 |           5 |           5 |      5 |
| 8600000US00623 |         5 |                   5 |           5 |           5 |      5 |

Return only the final code in markdown codeblock format, without any additional text or explanation. 



target: target.csv
train: source_0.csv
source_1.csv
source_2.csv
source_3.csv
source_4.csv
test: test_0.csv
test_1.csv
test_2.csv
test_3.csv
test_4.csv