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:
| State          | Participation   |   English |   Math |   Reading |   Science |   Composite |
|:---------------|:----------------|----------:|-------:|----------:|----------:|------------:|
| Missouri       | 100%            |      19.8 |   19.9 |      20.8 |      20.5 |        20.4 |
| Montana        | 100%            |      19   |   20.2 |      21   |      20.5 |        20.3 |
| Nebraska       | 84%             |      20.9 |   20.9 |      21.9 |      21.5 |        21.4 |
| Nevada         | 100%            |      16.3 |   18   |      18.1 |      18.2 |        17.8 |
| New Hampshire  | 18%             |      25.4 |   25.1 |      26   |      24.9 |        25.5 |
| New Jersey     | 34%             |      23.8 |   23.8 |      24.1 |      23.2 |        23.9 |
| New Mexico     | 66%             |      18.6 |   19.4 |      20.4 |      20   |        19.7 |
| New York       | 31%             |      23.8 |   24   |      24.6 |      23.9 |        24.2 |
| North Carolina | 100%            |      17.8 |   19.3 |      19.6 |      19.3 |        19.1 |
| North Dakota   | 98%             |      19   |   20.4 |      20.5 |      20.6 |        20.3 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| State                | Participation   |   Evidence-Based Reading and Writing |   Math |   Total |
|:---------------------|:----------------|-------------------------------------:|-------:|--------:|
| Alabama              | 5%              |                                  593 |    572 |    1165 |
| Alaska               | 38%             |                                  547 |    533 |    1080 |
| Arizona              | 30%             |                                  563 |    553 |    1116 |
| Arkansas             | 3%              |                                  614 |    594 |    1208 |
| California           | 53%             |                                  531 |    524 |    1055 |
| Colorado             | 11%             |                                  606 |    595 |    1201 |
| Connecticut          | 100%            |                                  530 |    512 |    1041 |
| Delaware             | 100%            |                                  503 |    492 |     996 |
| District of Columbia | 100%            |                                  482 |    468 |     950 |
| Florida              | 83%             |                                  520 |    497 |    1017 |


Target Schema:
| State                | Participation_x   |   English |   Math_x |   Reading |   Science |   Composite | Participation_y   |   Evidence-Based Reading and Writing |   Math_y |   Total |
|:---------------------|:------------------|----------:|---------:|----------:|----------:|------------:|:------------------|-------------------------------------:|---------:|--------:|
| Alabama              | 100%              |      18.9 |     18.4 |      19.7 |      19.4 |        19.2 | 5%                |                                  593 |      572 |    1165 |
| Alaska               | 65%               |      18.7 |     19.8 |      20.4 |      19.9 |        19.8 | 38%               |                                  547 |      533 |    1080 |
| Arizona              | 62%               |      18.6 |     19.8 |      20.1 |      19.8 |        19.7 | 30%               |                                  563 |      553 |    1116 |
| Arkansas             | 100%              |      18.9 |     19   |      19.7 |      19.5 |        19.4 | 3%                |                                  614 |      594 |    1208 |
| California           | 31%               |      22.5 |     22.7 |      23.1 |      22.2 |        22.8 | 53%               |                                  531 |      524 |    1055 |
| Colorado             | 100%              |      20.1 |     20.3 |      21.2 |      20.9 |        20.8 | 11%               |                                  606 |      595 |    1201 |
| Connecticut          | 31%               |      25.5 |     24.6 |      25.6 |      24.6 |        25.2 | 100%              |                                  530 |      512 |    1041 |
| Delaware             | 18%               |      24.1 |     23.4 |      24.8 |      23.6 |        24.1 | 100%              |                                  503 |      492 |     996 |
| District of Columbia | 32%               |      24.4 |     23.5 |      24.9 |      23.5 |        24.2 | 100%              |                                  482 |      468 |     950 |
| Florida              | 73%               |      19   |     19.4 |      21   |      19.4 |        19.8 | 83%               |                                  520 |      497 |    1017 |

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
test: test_0.csv
test_1.csv