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        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #3
Filename: source_10.csv
Sample Rows in Markdown:
| country     |   cpi |
|:------------|------:|
| Denmark     |  10   |
| Finland     |   9.6 |
| Sweden      |   9.5 |
| New Zealand |   9.4 |
| Iceland     |   9.3 |
| Canada      |   9.2 |
| Singapore   |   9.1 |
| Netherlands |   9   |
| Norway      |   9   |
| Switzerland |   8.9 |


Table #4
Filename: source_11.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #5
Filename: source_12.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #6
Filename: source_13.csv
Sample Rows in Markdown:
| country     |   cpi |
|:------------|------:|
| Denmark     |  9.94 |
| Finland     |  9.48 |
| Sweden      |  9.35 |
| New Zealand |  9.23 |
| Canada      |  9.1  |
| Netherlands |  9.03 |
| Norway      |  8.92 |
| Australia   |  8.86 |
| Singapore   |  8.66 |
| Luxemburg   |  8.61 |


Table #7
Filename: source_14.csv
Sample Rows in Markdown:
| country     |   cpi |
|:------------|------:|
| Denmark     |   9.3 |
| New Zealand |   9.3 |
| Singapore   |   9.3 |
| Finland     |   9.2 |
| Sweden      |   9.2 |
| Canada      |   8.9 |
| Netherlands |   8.8 |
| Australia   |   8.7 |
| Switzerland |   8.7 |
| Norway      |   8.6 |


Table #8
Filename: source_15.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #9
Filename: source_16.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #10
Filename: source_2.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #11
Filename: source_3.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #12
Filename: source_4.csv
Sample Rows in Markdown:
| country         |   cpi |
|:----------------|------:|
| New Zealand     |  9.55 |
| Denmark         |  9.32 |
| Singapore       |  9.26 |
| Finland         |  9.12 |
| Canada          |  8.87 |
| Sweden          |  8.87 |
| Australia       |  8.8  |
| Switzerland     |  8.76 |
| The Netherlands |  8.69 |
| Norway          |  8.61 |


Table #13
Filename: source_5.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #14
Filename: source_6.csv
Sample Rows in Markdown:
| country     |   cpi |
|:------------|------:|
| New Zealand |  9.43 |
| Denmark     |  9.33 |
| Sweden      |  9.08 |
| Finland     |  9.05 |
| Canada      |  8.96 |
| Norway      |  8.87 |
| Singapore   |  8.8  |
| Switzerland |  8.76 |
| Netherlands |  8.71 |
| Australia   |  8.6  |


Table #15
Filename: source_7.csv
Sample Rows in Markdown:
| country    |     cpi |
|:-----------|--------:|
| Bahrain    | 5.10988 |
| Macau      | 5.11087 |
| Mauritius  | 5.06715 |
| Rwanda     | 4.98342 |
| Costa Rica | 4.79809 |
| Lithuania  | 4.75197 |
| Oman       | 4.83458 |
| Seychelles | 4.82171 |
| Hungary    | 4.55545 |
| Kuwait     | 4.61603 |


Table #16
Filename: source_8.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Table #17
Filename: source_9.csv
Sample Rows in Markdown:
| country        |   cpi |
|:---------------|------:|
| Denmark        |  10   |
| Finland        |   9.8 |
| New Zealand    |   9.4 |
| Canada         |   9.2 |
| Singapore      |   9.1 |
| Netherlands    |   9   |
| Norway         |   8.9 |
| Luxembourg     |   8.8 |
| Australia      |   8.7 |
| United Kingdom |   8.6 |


Target Schema:
| country         |   cpi |
|:----------------|------:|
| New Zealand     |  9.55 |
| Denmark         |  9.32 |
| Singapore       |  9.26 |
| Finland         |  9.12 |
| Canada          |  8.87 |
| Sweden          |  8.87 |
| Australia       |  8.8  |
| Switzerland     |  8.76 |
| The Netherlands |  8.69 |
| Norway          |  8.61 |

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_10.csv
source_11.csv
source_12.csv
source_13.csv
source_14.csv
source_15.csv
source_16.csv
source_2.csv
source_3.csv
source_4.csv
source_5.csv
source_6.csv
source_7.csv
source_8.csv
source_9.csv
test: test_0.csv
test_1.csv
test_10.csv
test_11.csv
test_12.csv
test_13.csv
test_14.csv
test_15.csv
test_16.csv
test_2.csv
test_3.csv
test_4.csv
test_5.csv
test_6.csv
test_7.csv
test_8.csv
test_9.csv