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:
| Wrestler      |   Wins |   Losses |   Draws |
|:--------------|-------:|---------:|--------:|
| Dean Ambrose  |    150 |       63 |       5 |
| Roman Reigns  |    187 |       19 |       7 |
| Cesaro        |    117 |       69 |       1 |
| Big E         |     96 |       86 |       1 |
| Luke Harper   |     55 |      122 |       3 |
| Kofi Kingston |     86 |       90 |       1 |
| Seth Rollins  |     51 |      124 |       1 |
| Ryback        |    138 |       34 |       2 |
| Dolph Ziggler |    115 |       52 |       2 |
| Sin Cara      |    115 |       50 |       1 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| Wrestler     |   Wins |   Losses |   Draws |
|:-------------|-------:|---------:|--------:|
| Christian    |     22 |       11 |       0 |
| Yoshi Tatsu  |     13 |       17 |       2 |
| Jason Jordan |     11 |       20 |       0 |
| Danny Burch  |      6 |       22 |       0 |
| Diego        |     27 |        1 |       0 |
| Fernando     |     27 |        1 |       0 |
| Curt Hawkins |      0 |       26 |       1 |
| Jake Carter  |     12 |       15 |       0 |
| Hunico       |      2 |       24 |       0 |
| Tyler Breeze |      7 |       19 |       0 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| Wrestler      |   Wins |   Losses |   Draws |
|:--------------|-------:|---------:|--------:|
| Dean Ambrose  |    133 |       67 |       4 |
| Kevin Owens   |     61 |      130 |       2 |
| Tyler Breeze  |     17 |      163 |       2 |
| AJ Styles     |    108 |       68 |       0 |
| Sami Zayn     |    111 |       59 |       6 |
| Dolph Ziggler |    114 |       56 |       2 |
| Zack Ryder    |    119 |       51 |       2 |
| Rusev         |     70 |       97 |       2 |
| Jey Uso       |     76 |       90 |       0 |
| Baron Corbin  |    103 |       59 |       3 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| Wrestler      |   Wins |   Losses |   Draws |
|:--------------|-------:|---------:|--------:|
| Dolph Ziggler |    134 |       60 |       2 |
| Seth Rollins  |     87 |      105 |       4 |
| Jimmy Uso     |    143 |       43 |       4 |
| Cesaro        |     64 |      120 |       1 |
| Jey Uso       |    139 |       42 |       4 |
| Goldust       |    101 |       77 |       1 |
| Bray Wyatt    |     49 |      129 |       0 |
| Jack Swagger  |     49 |      123 |       1 |
| Luke Harper   |     31 |      140 |       1 |
| Sheamus       |    141 |       29 |       2 |


Target Schema:
| Wrestler        |   2013 Wins |   2013 Losses |   2013 Draws |   2014 Wins |   2014 Losses |   2014 Draws |   2015 Wins |   2015 Losses |   2015 Draws |   2016 Wins |   2016 Losses |   2016 Draws |
|:----------------|------------:|--------------:|-------------:|------------:|--------------:|-------------:|------------:|--------------:|-------------:|------------:|--------------:|-------------:|
| Dean Ambrose    |          70 |           134 |            4 |         129 |            36 |            2 |         150 |            63 |            5 |         133 |            67 |            4 |
| Seth Rollins    |          50 |           150 |            4 |          87 |           105 |            4 |          51 |           124 |            1 |          39 |            75 |            4 |
| Randy Orton     |         129 |            63 |            8 |          33 |            87 |            5 |          81 |            10 |            1 |          39 |            21 |            0 |
| Roman Reigns    |          49 |           140 |            5 |         118 |            28 |            4 |         187 |            19 |            7 |         142 |            12 |            5 |
| Ryback          |         103 |            88 |            3 |          43 |           114 |            1 |         138 |            34 |            2 |          37 |            17 |            1 |
| Damien Sandow   |          39 |           147 |            3 |           3 |           113 |            0 |          50 |             9 |            2 |          11 |            18 |            0 |
| Alberto Del Rio |         126 |            53 |            4 |          31 |            82 |            1 |          26 |            13 |            2 |          24 |            65 |            2 |
| Dolph Ziggler   |          62 |           117 |            1 |         134 |            60 |            2 |         115 |            52 |            2 |         114 |            56 |            2 |
| Jack Swagger    |          56 |            96 |            2 |          49 |           123 |            1 |          65 |            65 |            0 |          73 |            70 |            0 |
| Kofi Kingston   |          66 |            79 |            4 |          82 |            72 |            1 |          86 |            90 |            1 |          95 |            39 |            1 |

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