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:
| Name              | Team   | Position   |   SnapsPlayed |
|:------------------|:-------|:-----------|--------------:|
| Danny Woodhead    | LAC    | RB         |           491 |
| Shane Vereen      | NE     | RB         |           294 |
| Joique Bell       | DET    | RB         |           554 |
| DeAngelo Williams | CAR    | RB         |           470 |
| Bobby Rainey      | TB     | RB         |           327 |
| Darren Sproles    | NO     | RB         |           357 |
| Matt Forte        | CHI    | RB         |           928 |
| Fred Jackson      | BUF    | RB         |           663 |
| Alfred Morris     | WAS    | RB         |           604 |
| Zac Stacy         | LAR    | RB         |           566 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| Name              | Team   | Position   |   SnapsPlayed |
|:------------------|:-------|:-----------|--------------:|
| Karlos Williams   | BUF    | RB         |           243 |
| Joseph Randle     | DAL    | RB         |           145 |
| David Johnson     | ARI    | RB         |           413 |
| Todd Gurley       | LAR    | RB         |           456 |
| Thomas Rawls      | SEA    | RB         |           289 |
| Mike Gillislee    | BUF    | RB         |           112 |
| Tim Hightower     | NO     | RB         |           192 |
| LeGarrette Blount | NE     | RB         |           309 |
| Adrian Peterson   | MIN    | RB         |           666 |
| Jeremy Hill       | CIN    | RB         |           459 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| Name              | Team   | Position   |   SnapsPlayed |
|:------------------|:-------|:-----------|--------------:|
| Ryan Mathews      | PHI    | RB         |           287 |
| Tevin Coleman     | ATL    | RB         |           353 |
| LeGarrette Blount | NE     | RB         |           529 |
| Ezekiel Elliott   | DAL    | RB         |           716 |
| LeSean McCoy      | BUF    | RB         |           645 |
| Danny Woodhead    | LAC    | RB         |            55 |
| Ameer Abdullah    | DET    | RB         |            57 |
| Devonta Freeman   | ATL    | RB         |           605 |
| Mark Ingram       | NO     | RB         |           530 |
| Jeremy Hill       | CIN    | RB         |           443 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| Name            | Team   | Position   |   SnapsPlayed |
|:----------------|:-------|:-----------|--------------:|
| Mark Ingram     | NO     | RB         |            36 |
| Isaiah Crowell  | NYJ    | RB         |           158 |
| Melvin Gordon   | LAC    | RB         |           270 |
| Sony Michel     | NE     | RB         |           134 |
| Austin Ekeler   | LAC    | RB         |           131 |
| Kenneth Dixon   | BAL    | RB         |            22 |
| Todd Gurley     | LAR    | RB         |           349 |
| Matt Breida     | SF     | RB         |           163 |
| Adrian Peterson | WAS    | RB         |           149 |
| Phillip Lindsay | DEN    | RB         |           173 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| Name            | Team   | Position   |   SnapsPlayed |
|:----------------|:-------|:-----------|--------------:|
| Andre Brown     | NYG    | RB         |           226 |
| Adrian Peterson | MIN    | RB         |           771 |
| CJ Spiller      | BUF    | RB         |           569 |
| Marshawn Lynch  | SEA    | RB         |           674 |
| Stevan Ridley   | NE     | RB         |           550 |
| Jamaal Charles  | KC     | RB         |           577 |
| Alfred Morris   | WAS    | RB         |           727 |
| Michael Turner  | ATL    | RB         |           476 |
| Doug Martin     | TB     | RB         |           821 |
| Darren Sproles  | NO     | RB         |           444 |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| Name              | Team   | Position   |   SnapsPlayed |
|:------------------|:-------|:-----------|--------------:|
| Alvin Kamara      | NO     | RB         |           464 |
| Dion Lewis        | NE     | RB         |           404 |
| Todd Gurley       | LAR    | RB         |           796 |
| Alex Collins      | BAL    | RB         |           378 |
| Mark Ingram       | NO     | RB         |           570 |
| Orleans Darkwa    | NYG    | RB         |           315 |
| Kareem Hunt       | KC     | RB         |           670 |
| Leonard Fournette | JAX    | RB         |           564 |
| Latavius Murray   | MIN    | RB         |           421 |
| Chris Thompson    | WAS    | RB         |           338 |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
| Name           | Team   | Position   |   SnapsPlayed |
|:---------------|:-------|:-----------|--------------:|
| Arian Foster   | HOU    | RB         |           621 |
| Marshawn Lynch | SEA    | RB         |           704 |
| DeMarco Murray | DAL    | RB         |           783 |
| Jeremy Hill    | CIN    | RB         |           501 |
| CJ Anderson    | DEN    | RB         |           495 |
| Ryan Mathews   | LAC    | RB         |           165 |
| Mark Ingram    | NO     | RB         |           470 |
| Eddie Lacy     | GB     | RB         |           687 |
| Jamaal Charles | KC     | RB         |           650 |
| Tre Mason      | LAR    | RB         |           368 |


Target Schema:
| Name            | Team   | Position   |   SnapsPlayed |
|:----------------|:-------|:-----------|--------------:|
| Andre Brown     | NYG    | RB         |           226 |
| Adrian Peterson | MIN    | RB         |           771 |
| CJ Spiller      | BUF    | RB         |           569 |
| Marshawn Lynch  | SEA    | RB         |           674 |
| Stevan Ridley   | NE     | RB         |           550 |
| Jamaal Charles  | KC     | RB         |           577 |
| Alfred Morris   | WAS    | RB         |           727 |
| Michael Turner  | ATL    | RB         |           476 |
| Doug Martin     | TB     | RB         |           821 |
| Darren Sproles  | NO     | RB         |           444 |

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