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 |
|----:|:---------------------|:-------|----:|-----:|------:|------:|-----:|-----:|
|  42 | DeAndre Jordan, C    | LAC    |  81 | 31.7 |  0.64 |  0.95 | 1.6  | 6.23 |
|  54 | DeMarcus Cousins, C  | NO/SAC |  72 | 34.2 |  1.81 | -0.46 | 1.35 | 5.48 |
|  44 | Ricky Rubio, G       | MIN    |  75 | 32.9 |  0.99 |  0.69 | 1.68 | 6.03 |
|  76 | Brandon Jennings, G  | NY/WSH |  81 | 22.2 |  1.22 |  0.13 | 1.35 | 4.01 |
|  79 | Jabari Parker, PF    | MIL    |  51 | 33.9 |  1.96 | -0.57 | 1.39 | 3.93 |
|  67 | Vince Carter, G      | MEM    |  73 | 24.7 | -0.25 |  1.95 | 1.7  | 4.3  |
|  71 | Seth Curry, G        | DAL    |  70 | 29   | -0.91 |  2.08 | 1.17 | 4.1  |
|  55 | Ryan Anderson, PF    | HOU    |  72 | 29.4 |  1.43 |  0.3  | 1.73 | 5.46 |
|  65 | Wesley Matthews, G   | DAL    |  73 | 34.2 | -1.64 |  2.41 | 0.77 | 4.4  |
|  41 | Patrick Beverley, PG | HOU    |  67 | 30.7 |  1.19 |  1.19 | 2.39 | 6.29 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
|   0 | 1                     | 2       |   3 |    4 |     5 |     6 |    7 |     8 |
|----:|:----------------------|:--------|----:|-----:|------:|------:|-----:|------:|
|  21 | Jrue Holiday, G       | NO      |  67 | 32.7 |  1.66 |  1.84 | 3.51 |  8.39 |
|  32 | Devin Booker, SG      | PHX     |  78 | 35   |  2.55 | -0.83 | 1.72 |  7.21 |
|  40 | Nikola Mirotic, F     | CHI     |  70 | 24   |  1.7  |  1.88 | 3.58 |  6.35 |
|  27 | Paul Millsap, F       | ATL     |  69 | 34   |  0.49 |  2.49 | 2.98 |  8.08 |
|   4 | Rudy Gobert, C        | UTAH    |  81 | 33.9 | -0.31 |  5.74 | 5.43 | 13.39 |
|  35 | Patrick Patterson, PF | TOR     |  65 | 24.6 |  0.68 |  3.51 | 4.19 |  6.66 |
|  37 | Gordon Hayward, F     | UTAH    |  73 | 34.5 |  1.18 |  0.79 | 1.97 |  6.51 |
|   3 | James Harden, SG      | HOU     |  81 | 36.4 |  7.89 | -3.26 | 4.62 | 13.85 |
|   1 | Stephen Curry, PG     | GS      |  79 | 33.4 |  9.25 | -1.29 | 7.96 | 19.03 |
|  34 | Lou Williams, SG      | HOU/LAL |  81 | 24.6 |  5.29 | -2.45 | 2.84 |  6.79 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
|   0 | 1                    | 2       |   3 |    4 |     5 |     6 |     7 |    8 |
|----:|:---------------------|:--------|----:|-----:|------:|------:|------:|-----:|
| 200 | Al-Farouq Aminu, PF  | POR     |  61 | 29.1 | -2.41 |  1.26 | -1.15 | 0.88 |
| 198 | Mike Dunleavy, SG    | ATL/CLE |  53 | 15.9 | -1.21 |  0.92 | -0.28 | 0.92 |
| 184 | Thon Maker, C        | MIL     |  57 |  9.9 | -0.41 |  1.56 |  1.14 | 1.12 |
| 185 | Leandro Barbosa, G   | PHX     |  67 | 14.4 | -0.33 |  0.08 | -0.25 | 1.12 |
| 187 | Kyle O'Quinn, C      | NY      |  79 | 15.6 | -0.17 | -0.41 | -0.58 | 1.06 |
| 173 | Davis Bertans, SF    | SA      |  67 | 12.1 |  0.73 | -0.26 |  0.46 | 1.29 |
| 186 | Courtney Lee, SG     | NY      |  77 | 31.9 | -0.41 | -0.79 | -1.2  | 1.11 |
| 162 | Kyle Anderson, SF    | SA      |  72 | 14.2 | -1.99 |  2.34 |  0.35 | 1.56 |
| 176 | Luc Mbah a Moute, PF | LAC     |  80 | 22.3 | -2.45 |  1.62 | -0.83 | 1.27 |
| 199 | Alex Abrines, G      | OKC     |  68 | 15.5 |  1.16 | -1.8  | -0.64 | 0.9  |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
|   0 | 1                   | 2       |   3 |    4 |     5 |     6 |     7 |    8 |
|----:|:--------------------|:--------|----:|-----:|------:|------:|------:|-----:|
| 156 | Otto Porter Jr., SF | WSH     |  80 | 32.6 | -0.31 | -0.66 | -0.96 | 1.66 |
| 129 | Zaza Pachulia, C    | GS      |  70 | 18.1 |  0.01 |  0.51 |  0.53 | 2.16 |
| 150 | Jerian Grant, PG    | CHI     |  63 | 16.3 | -0.51 |  1.19 |  0.69 | 1.76 |
| 124 | Mike Muscala, PF    | ATL     |  70 | 17.7 |  0.36 |  0.31 |  0.67 | 2.2  |
| 153 | Allen Crabbe, G     | POR     |  79 | 28.5 |  0.29 | -1.09 | -0.8  | 1.7  |
| 128 | Mirza Teletovic, PF | MIL     |  70 | 16.2 |  0.19 |  0.81 |  1    | 2.17 |
| 139 | Norman Powell, SG   | TOR     |  76 | 18   |  0.57 | -0.28 |  0.29 | 2.02 |
| 121 | Deron Williams, PG  | CLE/DAL |  64 | 25.9 | -0.2  |  0.37 |  0.18 | 2.25 |
| 148 | Luol Deng, F        | LAL     |  56 | 26.5 | -1.47 |  1.3  | -0.16 | 1.78 |
| 152 | Tarik Black, C      | LAL     |  67 | 16.3 | -0.67 |  1.04 |  0.37 | 1.71 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
|   0 | 1                       | 2       |   3 |    4 |     5 |     6 |     7 |    8 |
|----:|:------------------------|:--------|----:|-----:|------:|------:|------:|-----:|
| 231 | Raul Neto, G            | UTAH    |  40 |  8.7 | -1.35 |  1.88 |  0.53 | 0.56 |
| 211 | Terrence Jones, PF      | NO/MIL  |  54 | 23.5 | -0.28 | -0.74 | -1.02 | 0.75 |
| 205 | Cristiano Felicio, PF   | CHI     |  66 | 15.8 | -1.5  |  0.77 | -0.73 | 0.8  |
| 204 | Kris Humphries, PF      | ATL     |  56 | 12.3 | -1.91 |  1.77 | -0.14 | 0.81 |
| 217 | Matthew Dellavedova, PG | MIL     |  76 | 26.1 | -1.37 |  0.01 | -1.35 | 0.69 |
| 240 | Jonas Valanciunas, C    | TOR     |  80 | 25.8 | -1.2  | -0.31 | -1.51 | 0.48 |
| 221 | Darrell Arthur, F       | DEN     |  41 | 15.6 |  0.19 | -0.62 | -0.43 | 0.64 |
| 225 | Quincy Acy, F           | DAL/BKN |  38 | 14.7 | -1.09 |  0.8  | -0.3  | 0.62 |
| 224 | Delon Wright, G         | TOR     |  27 | 16.5 | -1.84 |  2.09 |  0.25 | 0.63 |
| 227 | Ian Mahinmi, C          | WSH     |  31 | 17.9 | -1.91 |  1.63 | -0.27 | 0.61 |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| 0   | 1                   | 2          | 3   | 4    | 5     | 6     | 7     | 8    |
|:----|:--------------------|:-----------|:----|:-----|:------|:------|:------|:-----|
| 265 | Alex Poythress, F   | PHI        | 6   | 26.2 | -0.02 | 0.17  | 0.15  | 0.22 |
| 275 | Cheick Diallo, PF   | NO         | 17  | 11.7 | -0.45 | -0.19 | -0.65 | 0.17 |
| 249 | Hollis Thompson, F  | NO/PHI     | 40  | 18.8 | -2.08 | 0.91  | -1.17 | 0.36 |
| RK  | NAME                | TEAM       | GP  | MPG  | ORPM  | DRPM  | RPM   | WINS |
| 272 | Anthony Brown, F    | NO/ORL     | 11  | 14.5 | -0.68 | 0.63  | -0.05 | 0.19 |
| 261 | Lance Stephenson, G | NO/IND/MIN | 18  | 20.1 | -1.61 | 0.82  | -0.79 | 0.27 |
| 274 | Al Jefferson, C     | IND        | 66  | 14.1 | -1.15 | -0.43 | -1.58 | 0.18 |
| 244 | Justise Winslow, SF | MIA        | 18  | 34.7 | -2.49 | 1.56  | -0.93 | 0.40 |
| 257 | Meyers Leonard, C   | POR        | 74  | 16.5 | -0.84 | -0.65 | -1.49 | 0.31 |
| 242 | Pat Connaughton, G  | POR        | 39  | 8.1  | -0.05 | 0.13  | 0.09  | 0.42 |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
|   0 | 1                   | 2       |   3 |    4 |     5 |     6 |     7 |    8 |
|----:|:--------------------|:--------|----:|-----:|------:|------:|------:|-----:|
|  94 | Josh Richardson, G  | MIA     |  53 | 30.5 | -1.43 |  2.37 |  0.94 | 3.12 |
|  96 | Thaddeus Young, PF  | IND     |  74 | 30.2 | -0.14 |  0.22 |  0.08 | 3.07 |
| 111 | James Ennis III, SF | MEM     |  64 | 23.5 | -2.17 |  2.9  |  0.73 | 2.61 |
|  99 | Jeremy Lin, G       | BKN     |  36 | 24.5 |  3.8  | -1.19 |  2.61 | 2.98 |
| 100 | Markieff Morris, PF | WSH     |  76 | 31.2 | -0.97 |  0.83 | -0.14 | 2.87 |
| 120 | P.J. Tucker, PF     | PHX/TOR |  81 | 27.6 | -3.05 |  2.67 | -0.38 | 2.33 |
| 117 | Greg Monroe, C      | MIL     |  81 | 22.5 |  1.21 | -1.15 |  0.06 | 2.39 |
|  81 | Joe Ingles, SG      | UTAH    |  82 | 24   |  0.63 |  0.4  |  1.03 | 3.85 |
|  95 | Dwight Howard, C    | ATL     |  74 | 29.7 | -0.36 |  0.52 |  0.16 | 3.12 |
|  83 | Justin Holiday, SF  | NY      |  82 | 20   | -0.59 |  2.01 |  1.42 | 3.7  |


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   |
|----:|:---------------------|:------------|----:|-----:|------:|------:|-----:|------:|:------|:-------|:-------|:-------|:-------|:-------|:-------|:-------|:-------|
|  39 | Blake Griffin, PF    | LAC         |  61 | 34   |  2.29 |  0.22 | 2.51 |  6.38 |       |        |        |        |        |        |        |        |        |
|  15 | Draymond Green, PF   | GS          |  76 | 32.5 |  0.78 |  2.68 | 3.46 |  9.46 |       |        |        |        |        |        |        |        |        |
|  36 | Ersan Ilyasova, F    | ATL/PHI/OKC |  82 | 26.1 |  1.46 |  1    | 2.45 |  6.62 |       |        |        |        |        |        |        |        |        |
|  26 | John Wall, PG        | WSH         |  78 | 36.4 |  3.79 | -1.63 | 2.16 |  8.15 |       |        |        |        |        |        |        |        |        |
|  11 | Kevin Durant, SF     | GS          |  62 | 33.4 |  5.22 | -0.5  | 4.73 |  9.85 |       |        |        |        |        |        |        |        |        |
|  17 | Paul George, SG      | IND         |  75 | 35.9 |  2.29 |  0.62 | 2.91 |  9.01 |       |        |        |        |        |        |        |        |        |
|  31 | Eric Gordon, SG      | HOU         |  75 | 31   |  2.69 | -0.12 | 2.57 |  7.39 |       |        |        |        |        |        |        |        |        |
|   7 | Kyle Lowry, PG       | TOR         |  60 | 37.4 |  4.84 |  1.23 | 6.07 | 12.19 |       |        |        |        |        |        |        |        |        |
|  28 | Victor Oladipo, SG   | OKC         |  67 | 33.2 |  1.02 |  2.12 | 3.14 |  7.94 |       |        |        |        |        |        |        |        |        |
|  25 | Robert Covington, PF | PHI         |  67 | 31.6 | -0.72 |  4.32 | 3.6  |  8.32 |       |        |        |        |        |        |        |        |        |

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