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:
| Mouse ID   |   Timepoint |   Tumor Volume (mm3) |   Metastatic Sites |
|:-----------|------------:|---------------------:|-------------------:|
| n763       |          20 |              49.2581 |                  1 |
| q787       |          20 |              50.2299 |                  2 |
| y163       |          20 |              54.5711 |                  1 |
| g570       |          20 |              54.6433 |                  1 |
| g989       |          20 |              55.3261 |                  1 |
| s141       |          20 |              51.6216 |                  1 |
| q511       |          20 |              52.6727 |                  0 |
| s121       |          20 |              52.0051 |                  2 |
| t718       |          20 |              52.6367 |                  2 |
| k210       |          20 |              51.9976 |                  0 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| Mouse ID   | Drug     |
|:-----------|:---------|
| f234       | Stelasyn |
| x402       | Stelasyn |
| a492       | Stelasyn |
| w540       | Stelasyn |
| v764       | Stelasyn |
| o848       | Stelasyn |
| z314       | Stelasyn |
| g989       | Stelasyn |
| m269       | Stelasyn |
| a963       | Stelasyn |


Target Schema:
|   Timepoint |   Capomulin | Ceftamin           |   Infubinol | Ketapril           | Naftisol          |   Placebo |   Propriva | Ramicane           | Stelasyn           |   Zoniferol |
|------------:|------------:|:-------------------|------------:|:-------------------|:------------------|----------:|-----------:|:-------------------|:-------------------|------------:|
|           0 |     45      | 45.0               |     45      | 45.0               | 45.0              |   45      |    45      | 45.0               | 45.0               |     45      |
|           5 |     44.2661 | 46.503050958038095 |     47.062  | 47.38917452114347  | 46.7960980984913  |   47.1256 |    47.249  | 43.944859399664004 | 47.527451674148004 |     46.8518 |
|          10 |     43.0843 | 48.285125215945    |     49.4039 | 49.582268974622714 | 48.69420960404763 |   49.4233 |    49.1015 | 42.53195729572083  | 49.46384376145653  |     48.6899 |
|          15 |     42.0643 | 50.094054891747376 |     51.2964 | 52.39997374321579  | 50.93301827607619 |   51.3597 |    51.0673 | 41.4950609236625   | 51.52940872284348  |     50.7791 |
|          20 |     37.5055 |                    |     53.1541 |                    |                   |   55.8114 |    52.3807 |                    |                    |     51.8266 |

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