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:
| country   |   year |   NY.GDP.MKTP.KN |   SI.DST.10TH.10 |   SP.POP.TOTL |
|:----------|-------:|-----------------:|-----------------:|--------------:|
| Honduras  |   2010 |      1.59828e+11 |             40.2 |   8.31747e+06 |
| Honduras  |   2009 |      1.54079e+11 |             38.4 |   8.15078e+06 |
| Honduras  |   2008 |      1.57919e+11 |             43   |   7.98096e+06 |
| Honduras  |   2007 |      1.51508e+11 |             43.1 |   7.80852e+06 |
| Honduras  |   2006 |      1.42678e+11 |             44   |   7.6343e+06  |
| Honduras  |   2005 |      1.33886e+11 |             46.1 |   7.45898e+06 |
| Honduras  |   2004 |      1.26247e+11 |             44.9 |   7.28295e+06 |
| Honduras  |   2003 |      1.1884e+11  |             45.1 |   7.10632e+06 |
| Honduras  |   2002 |      1.13672e+11 |             42.7 |   6.92926e+06 |
| Honduras  |   2001 |      1.09559e+11 |             41.8 |   6.75191e+06 |


Target Schema:
| country             | NY.GDP.MKTP.KN_x   | SI.DST.10TH.10_x   |   SP.POP.TOTL_x | NY.GDP.MKTP.KN_y   | SI.DST.10TH.10_y   |   SP.POP.TOTL_y | NY.GDP.MKTP.KN   | SI.DST.10TH.10   |     SP.POP.TOTL |
|:--------------------|:-------------------|:-------------------|----------------:|:-------------------|:-------------------|----------------:|:-----------------|:-----------------|----------------:|
| Afghanistan         | 256988058255.55    |                    |     1.83911e+07 | 256988058255.55    |                    |     1.83911e+07 | 256988058255.55  |                  |     1.83911e+07 |
| Albania             | 721380751769.19    | 23.85              |     3.04443e+06 | 721380751769.19    | 23.85              |     3.04443e+06 | 721380751769.19  | 23.85            |     3.04443e+06 |
| Algeria             | 3237343118255.67   | 29.85              |     2.81015e+07 | 3237343118255.67   | 29.85              |     2.81015e+07 | 3237343118255.67 | 29.85            |     2.81015e+07 |
| American Samoa      | 719777777.77       |                    | 50194.1         | 719777777.77       |                    | 50194.1         | 719777777.77     |                  | 50194.1         |
| Andorra             | 1819767491.52      |                    | 61322.5         | 1819767491.52      |                    | 61322.5         | 1819767491.52    |                  | 61322.5         |
| Angola              | 618440209636.9     | 36.25              |     1.45772e+07 | 618440209636.9     | 36.25              |     1.45772e+07 | 618440209636.9   | 36.25            |     1.45772e+07 |
| Antigua and Barbuda | 2006097351.15      |                    | 70947.4         | 2006097351.15      |                    | 70947.4         | 2006097351.15    |                  | 70947.4         |
| Arab World          |                    |                    |     2.53755e+08 |                    |                    |     2.53755e+08 |                  |                  |     2.53755e+08 |
| Argentina           | 438317875725.07    | 35.23              |     3.46269e+07 | 438317875725.07    | 35.23              |     3.46269e+07 | 438317875725.07  | 35.23            |     3.46269e+07 |
| Armenia             | 2388508725205.64   | 27.23              |     3.18563e+06 | 2388508725205.64   | 27.23              |     3.18563e+06 | 2388508725205.64 | 27.23            |     3.18563e+06 |

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



target: target.csv
train: source_0.csv
test: test_0.csv