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:
| 0   | 1                       | 2    | 3   | 4    | 5     | 6     | 7     | 8    |
|:----|:------------------------|:-----|:----|:-----|:------|:------|:------|:-----|
| 173 | Davis Bertans, SF       | SA   | 67  | 12.1 | 0.73  | -0.26 | 0.46  | 1.29 |
| 174 | Rodney Hood, SF         | UTAH | 59  | 27.0 | -1.79 | 1.15  | -0.64 | 1.28 |
| 195 | Denzel Valentine, SG    | CHI  | 57  | 17.1 | -0.43 | 0.02  | -0.41 | 0.96 |
| RK  | NAME                    | TEAM | GP  | MPG  | ORPM  | DRPM  | RPM   | WINS |
| 180 | Montrezl Harrell, F     | HOU  | 58  | 18.3 | 1.47  | -1.81 | -0.35 | 1.16 |
| 177 | Ty Lawson, G            | SAC  | 69  | 25.1 | 0.06  | -0.87 | -0.81 | 1.26 |
| 171 | Jordan Crawford, G      | NO   | 19  | 23.3 | 4.58  | -1.90 | 2.68  | 1.39 |
| 178 | Thabo Sefolosha, SF     | ATL  | 62  | 25.7 | -1.78 | 0.98  | -0.80 | 1.19 |
| 170 | Nikola Vucevic, C       | ORL  | 75  | 28.8 | -0.56 | -0.38 | -0.94 | 1.42 |
| 161 | Mindaugas Kuzminskas, F | NY   | 68  | 14.9 | 0.69  | -0.30 | 0.39  | 1.58 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| 0   | 1                   | 2       | 3   | 4    | 5     | 6     | 7     | 8    |
|:----|:--------------------|:--------|:----|:-----|:------|:------|:------|:-----|
| RK  | NAME                | TEAM    | GP  | MPG  | ORPM  | DRPM  | RPM   | WINS |
| 307 | Jordan Clarkson, PG | LAL     | 82  | 29.2 | -0.03 | -1.80 | -1.83 | 0.04 |
| 314 | Jordan Hill, C      | MIN     | 7   | 6.7  | -2.80 | 1.23  | -1.57 | 0.01 |
| 316 | Ben McLemore, SF    | SAC     | 61  | 19.3 | -1.15 | -0.69 | -1.84 | 0.01 |
| 308 | Josh Huestis, F     | OKC     | 2   | 15.5 | -0.54 | 0.37  | -0.17 | 0.04 |
| 290 | Reggie Williams, SF | NO      | 6   | 13.2 | -0.84 | 0.57  | -0.27 | 0.09 |
| 286 | Tony Snell, SF      | MIL     | 80  | 29.2 | -1.17 | -0.62 | -1.79 | 0.11 |
| 298 | Andrew Bogut, C     | CLE/DAL | 27  | 21.6 | -4.51 | 2.83  | -1.68 | 0.07 |
| 293 | Tiago Splitter, C   | PHI     | 8   | 9.5  | -1.10 | 0.46  | -0.64 | 0.07 |
| 291 | Pierre Jackson, PG  | DAL     | 8   | 10.5 | -1.72 | 1.36  | -0.36 | 0.09 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| 0   | 1                   | 2          | 3   | 4    | 5     | 6     | 7     | 8    |
|:----|:--------------------|:-----------|:----|:-----|:------|:------|:------|:-----|
| 267 | James Jones, SG     | CLE        | 48  | 7.9  | -0.79 | -0.26 | -1.05 | 0.21 |
| 254 | Damjan Rudez, SF    | ORL        | 45  | 7.0  | -0.47 | 0.16  | -0.32 | 0.33 |
| 277 | Nik Stauskas, G     | PHI        | 80  | 27.4 | -0.30 | -1.45 | -1.75 | 0.16 |
| 248 | Taj Gibson, C       | CHI/OKC    | 78  | 25.5 | -1.73 | 0.14  | -1.59 | 0.36 |
| 261 | Lance Stephenson, G | NO/IND/MIN | 18  | 20.1 | -1.61 | 0.82  | -0.79 | 0.27 |
| 252 | Isaiah Whitehead, G | BKN        | 73  | 22.5 | -0.99 | -0.57 | -1.56 | 0.35 |
| 270 | Jodie Meeks, G      | ORL        | 36  | 20.5 | 1.12  | -2.60 | -1.48 | 0.19 |
| 249 | Hollis Thompson, F  | NO/PHI     | 40  | 18.8 | -2.08 | 0.91  | -1.17 | 0.36 |
| 251 | Dante Exum, PG      | UTAH       | 66  | 18.6 | -2.08 | 0.66  | -1.42 | 0.35 |
| RK  | NAME                | TEAM       | GP  | MPG  | ORPM  | DRPM  | RPM   | WINS |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| 0   | 1                       | 2       | 3   | 4    | 5     | 6     | 7     | 8    |
|:----|:------------------------|:--------|:----|:-----|:------|:------|:------|:-----|
| 223 | Rodney McGruder, SG     | MIA     | 78  | 25.2 | -1.30 | -0.09 | -1.38 | 0.63 |
| 232 | Justin Hamilton, C      | BKN     | 64  | 18.4 | -0.20 | -1.01 | -1.21 | 0.55 |
| 217 | Matthew Dellavedova, PG | MIL     | 76  | 26.1 | -1.37 | 0.01  | -1.35 | 0.69 |
| 235 | Brandan Wright, F       | MEM     | 28  | 16.0 | -1.28 | 1.16  | -0.13 | 0.52 |
| 203 | Solomon Hill, F         | NO      | 80  | 29.7 | -1.20 | -0.16 | -1.36 | 0.84 |
| 211 | Terrence Jones, PF      | NO/MIL  | 54  | 23.5 | -0.28 | -0.74 | -1.02 | 0.75 |
| RK  | NAME                    | TEAM    | GP  | MPG  | ORPM  | DRPM  | RPM   | WINS |
| 236 | Evan Turner, SG         | POR     | 65  | 25.5 | -2.67 | 1.26  | -1.41 | 0.51 |
| 227 | Ian Mahinmi, C          | WSH     | 31  | 17.9 | -1.91 | 1.63  | -0.27 | 0.61 |
| 215 | Corey Brewer, SG        | HOU/LAL | 82  | 15.6 | -0.91 | -0.16 | -1.07 | 0.71 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
|   0 | 1                   | 2   |   3 |    4 |     5 |     6 |     7 |    8 |
|----:|:--------------------|:----|----:|-----:|------:|------:|------:|-----:|
| 155 | Harrison Barnes, SF | DAL |  79 | 35.5 | -2.99 |  2.01 | -0.97 | 1.66 |
| 123 | Tyson Chandler, C   | PHX |  47 | 27.6 | -0.78 |  1.25 |  0.48 | 2.21 |
| 131 | J.J. Barea, PG      | DAL |  35 | 22   |  2.6  | -0.26 |  2.33 | 2.16 |
| 156 | Otto Porter Jr., SF | WSH |  80 | 32.6 | -0.31 | -0.66 | -0.96 | 1.66 |
| 130 | Marvin Williams, F  | CHA |  76 | 30.2 | -0.95 |  0.46 | -0.5  | 2.16 |
| 125 | Aron Baynes, C      | DET |  75 | 15.5 | -2.85 |  3.8  |  0.95 | 2.2  |
| 136 | Jeff Teague, G      | IND |  82 | 32.4 |  1.13 | -1.87 | -0.73 | 2.11 |
| 157 | Channing Frye, F    | CLE |  74 | 18.9 |  0.97 | -1.12 | -0.15 | 1.64 |
| 150 | Jerian Grant, PG    | CHI |  63 | 16.3 | -0.51 |  1.19 |  0.69 | 1.76 |
| 154 | Lucas Nogueira, C   | TOR |  57 | 19.1 | -1.03 |  1.41 |  0.38 | 1.68 |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| 0   | 1                      | 2    | 3   | 4    | 5     | 6     | 7     | 8    |
|:----|:-----------------------|:-----|:----|:-----|:------|:------|:------|:-----|
| 93  | Kristaps Porzingis, PF | NY   | 66  | 32.8 | -0.13 | 0.36  | 0.23  | 3.13 |
| 97  | Garrett Temple, G      | SAC  | 65  | 26.6 | -0.34 | 1.01  | 0.68  | 3.03 |
| RK  | NAME                   | TEAM | GP  | MPG  | ORPM  | DRPM  | RPM   | WINS |
| 89  | Marcin Gortat, C       | WSH  | 82  | 31.2 | -0.32 | 0.32  | 0.00  | 3.34 |
| 104 | David Lee, PF          | SA   | 79  | 18.7 | 0.48  | 0.40  | 0.88  | 2.78 |
| 85  | Enes Kanter, C         | OKC  | 72  | 21.3 | 2.10  | -0.55 | 1.56  | 3.63 |
| 92  | Evan Fournier, SG      | ORL  | 68  | 32.9 | 0.14  | 0.03  | 0.18  | 3.23 |
| 82  | Troy Daniels, G        | MEM  | 67  | 17.7 | 1.08  | 1.81  | 2.88  | 3.79 |
| 100 | Markieff Morris, PF    | WSH  | 76  | 31.2 | -0.97 | 0.83  | -0.14 | 2.87 |
| 94  | Josh Richardson, G     | MIA  | 53  | 30.5 | -1.43 | 2.37  | 0.94  | 3.12 |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
|   0 | 1                        | 2    |   3 |    4 |     5 |     6 |    7 |     8 |
|----:|:-------------------------|:-----|----:|-----:|------:|------:|-----:|------:|
|  19 | Kawhi Leonard, SF        | SA   |  74 | 33.4 |  3.41 | -0.07 | 3.34 |  8.79 |
|   4 | Rudy Gobert, C           | UTAH |  81 | 33.9 | -0.31 |  5.74 | 5.43 | 13.39 |
|  11 | Kevin Durant, SF         | GS   |  62 | 33.4 |  5.22 | -0.5  | 4.73 |  9.85 |
|  26 | John Wall, PG            | WSH  |  78 | 36.4 |  3.79 | -1.63 | 2.16 |  8.15 |
|   2 | LeBron James, SF         | CLE  |  74 | 37.8 |  6.96 |  0.63 | 7.59 | 18.31 |
|  21 | Jrue Holiday, G          | NO   |  67 | 32.7 |  1.66 |  1.84 | 3.51 |  8.39 |
|  13 | Giannis Antetokounmpo, F | MIL  |  80 | 35.6 |  1.25 |  1.88 | 3.13 |  9.68 |
|  20 | Myles Turner, C          | IND  |  81 | 31.4 | -0.14 |  3.01 | 2.86 |  8.47 |
|  40 | Nikola Mirotic, F        | CHI  |  70 | 24   |  1.7  |  1.88 | 3.58 |  6.35 |
|   7 | Kyle Lowry, PG           | TOR  |  60 | 37.4 |  4.84 |  1.23 | 6.07 | 12.19 |


Table #8
Filename: source_7.csv
Sample Rows in Markdown:
|   0 | 1                            | 2   |   3 |    4 |     5 |     6 |    7 |    8 |
|----:|:-----------------------------|:----|----:|-----:|------:|------:|-----:|-----:|
|  52 | Tobias Harris, SF            | DET |  82 | 31.3 |  0.27 |  1.09 | 1.37 | 5.66 |
|  66 | DeMarre Carroll, SF          | TOR |  72 | 26.1 |  0.26 |  1.27 | 1.53 | 4.33 |
|  60 | Kentavious Caldwell-Pope, SG | DET |  76 | 33.3 |  0.95 | -0.02 | 0.93 | 4.88 |
|  58 | Maurice Harkless, F          | POR |  77 | 28.9 |  0.51 |  0.83 | 1.34 | 4.99 |
|  62 | Danny Green, G               | SA  |  68 | 26.6 | -1.16 |  3.16 | 2    | 4.64 |
|  57 | Hassan Whiteside, C          | MIA |  77 | 32.6 |  0.17 |  1.01 | 1.18 | 5.31 |
|  45 | LaMarcus Aldridge, PF        | SA  |  72 | 32.4 | -1.8  |  3.77 | 1.98 | 5.98 |
|  49 | JJ Redick, SG                | LAC |  78 | 28.2 |  1.89 | -0.06 | 1.83 | 5.73 |
|  64 | James Johnson, F             | MIA |  76 | 27.4 |  0.45 |  0.74 | 1.2  | 4.51 |
|  55 | Ryan Anderson, PF            | HOU |  72 | 29.4 |  1.43 |  0.3  | 1.73 | 5.46 |


Target Schema:
|   0 | 1                     | 2       |   3 |    4 |    5 |     6 |    7 |     8 | 0_9   | 1_10   | 2_11   | 3_12   | 4_13   | 5_14   | 6_15   | 7_16   | 8_17   |
|----:|:----------------------|:--------|----:|-----:|-----:|------:|-----:|------:|:------|:-------|:-------|:-------|:-------|:-------|:-------|:-------|:-------|
|   1 | Stephen Curry, PG     | GS      |  79 | 33.4 | 9.25 | -1.29 | 7.96 | 19.03 |       |        |        |        |        |        |        |        |        |
|  29 | Isaiah Thomas, PG     | BOS     |  76 | 33.8 | 6.13 | -3.65 | 2.48 |  7.91 |       |        |        |        |        |        |        |        |        |
|  30 | Karl-Anthony Towns, C | MIN     |  82 | 37   | 2.82 | -1.06 | 1.76 |  7.58 |       |        |        |        |        |        |        |        |        |
|  32 | Devin Booker, SG      | PHX     |  78 | 35   | 2.55 | -0.83 | 1.72 |  7.21 |       |        |        |        |        |        |        |        |        |
|  34 | Lou Williams, SG      | HOU/LAL |  81 | 24.6 | 5.29 | -2.45 | 2.84 |  6.79 |       |        |        |        |        |        |        |        |        |
|  10 | Klay Thompson, SG     | GS      |  78 | 34   | 3.61 |  0.37 | 3.98 | 11.01 |       |        |        |        |        |        |        |        |        |
|  33 | Kevin Love, PF        | CLE     |  60 | 31.4 | 2.66 |  0.87 | 3.53 |  7.09 |       |        |        |        |        |        |        |        |        |
|  12 | Nikola Jokic, C       | DEN     |  73 | 27.9 | 5.21 | -0.43 | 4.78 |  9.68 |       |        |        |        |        |        |        |        |        |
|   5 | Jimmy Butler, SF      | CHI     |  76 | 37   | 2.21 |  2.69 | 4.9  | 13.11 |       |        |        |        |        |        |        |        |        |
|  35 | Patrick Patterson, PF | TOR     |  65 | 24.6 | 0.68 |  3.51 | 4.19 |  6.66 |       |        |        |        |        |        |        |        |        |

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
source_5.csv
source_6.csv
source_7.csv
test: test_0.csv
test_1.csv
test_2.csv
test_3.csv
test_4.csv
test_5.csv
test_6.csv
test_7.csv