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:
|   PassengerId |   Survived |   Pclass | Name                              | Sex    | Age   |   SibSp |   Parch | Ticket     |    Fare | Cabin   | Embarked   |
|--------------:|-----------:|---------:|:----------------------------------|:-------|:------|--------:|--------:|:-----------|--------:|:--------|:-----------|
|           446 |          1 |        1 | Dodge, Master. Washington         | male   | 4.0   |       0 |       2 | 33638      | 81.8583 | A34     | S          |
|           447 |          1 |        2 | Mellinger, Miss. Madeleine Violet | female | 13.0  |       0 |       1 | 250644     | 19.5    |         | S          |
|           448 |          1 |        1 | Seward, Mr. Frederic Kimber       | male   | 34.0  |       0 |       0 | 113794     | 26.55   |         | S          |
|           449 |          1 |        3 | Baclini, Miss. Marie Catherine    | female | 5.0   |       2 |       1 | 2666       | 19.2583 |         | C          |
|           450 |          1 |        1 | Peuchen, Major. Arthur Godfrey    | male   | 52.0  |       0 |       0 | 113786     | 30.5    | C104    | S          |
|           451 |          0 |        2 | West, Mr. Edwy Arthur             | male   | 36.0  |       1 |       2 | C.A. 34651 | 27.75   |         | S          |
|           452 |          0 |        3 | Hagland, Mr. Ingvald Olai Olsen   | male   |       |       1 |       0 | 65303      | 19.9667 |         | S          |
|           453 |          0 |        1 | Foreman, Mr. Benjamin Laventall   | male   | 30.0  |       0 |       0 | 113051     | 27.75   | C111    | C          |
|           454 |          1 |        1 | Goldenberg, Mr. Samuel L          | male   | 49.0  |       1 |       0 | 17453      | 89.1042 | C92     | C          |
|           455 |          0 |        3 | Peduzzi, Mr. Joseph               | male   |       |       0 |       0 | A/5 2817   |  8.05   |         | S          |


Target Schema:
| Name    |
|:--------|
| Harris  |
| Bradley |
|         |
| Heath   |
| Henry   |
|         |
| J       |
| Leonard |
| W       |
| (Adele  |

Return only the final code in markdown codeblock format, without any additional text or explanation. 



target: target.csv
train: source_0.csv
test: test_0.csv