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:
| 2012-12-05   |   0.7268 |
|:-------------|---------:|
| 2018-03-15   | 1.55422  |
| 2015-09-13   | 1.85376  |
| 2013-06-28   | 0.8621   |
| 2016-11-07   | 0.959882 |
| 2015-10-29   | 1.98369  |
| 2014-09-28   | 1.258    |
| 2017-10-09   | 1.78249  |
| 2014-08-12   | 1.943    |
| 2017-07-03   | 4.52524  |
| 2015-06-16   | 0.618837 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.016157143 |
|:-------------|--------------:|
| 2015-10-29   |    0.0126     |
| 2018-03-15   |    0.0067     |
| 2017-05-26   |    0.0284583  |
| 2017-10-09   |    0.0099     |
| 2016-11-07   |    0.0716833  |
| 2014-02-26   |    0.00893333 |
| 2014-05-13   |    0.00666667 |
| 2016-07-24   |    0.1005     |
| 2017-03-14   |    0.057275   |
| 2017-08-15   |    0.0034     |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.17657143 |
|:-------------|-------------:|
| 2018-03-15   |    0.01      |
| 2017-08-15   |    0.057     |
| 2014-05-13   |    0.011     |
| 2015-07-27   |    0.0203333 |
| 2017-07-03   |    0.058     |
| 2014-09-28   |    0.051     |
| 2017-10-09   |    0.023     |
| 2016-11-07   |    0.0655    |
| 2013-10-26   |    0.882     |
| 2014-08-12   |    0.03      |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| 2012-12-05   |   6.9 |
|:-------------|------:|
| 2014-02-26   |   2   |
| 2015-10-29   |  48   |
| 2013-03-15   |   5.5 |
| 2015-09-13   |  90   |
| 2017-05-26   |   5.5 |
| 2018-06-07   |   7.3 |
| 2019-02-15   |   9.5 |
| 2017-08-15   |  34   |
| 2016-04-28   |  21   |
| 2018-12-19   |   4.8 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.0075805085 |
|:-------------|---------------:|
| 2017-10-09   |     0.0069     |
| 2017-05-26   |     0.0217083  |
| 2014-02-26   |     0.00696667 |
| 2018-06-07   |     0.00543333 |
| 2018-02-11   |     0.00653333 |
| 2014-08-12   |     0.0033     |
| 2013-03-15   |     0.00766017 |
| 2019-02-15   |     0.03217    |
| 2014-03-25   |     0.00605    |
| 2013-09-17   |     0.0088     |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.0179 |
|:-------------|---------:|
| 2015-07-27   | 0.03748  |
| 2014-06-25   | 0.029    |
| 2018-02-11   | 0.026406 |
| 2016-04-28   | 0.058535 |
| 2017-05-26   | 0.00866  |
| 2016-07-24   | 0.020928 |
| 2013-01-08   | 0.0203   |
| 2018-10-25   | 0.03646  |
| 2018-12-19   | 0.02123  |
| 2014-09-28   | 0.03     |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
| 2012-12-05   |   242.364 |
|:-------------|----------:|
| 2014-02-26   |   324.9   |
| 2015-03-21   |   175.57  |
| 2015-10-29   |   149.76  |
| 2016-04-28   |   208.64  |
| 2015-06-16   |   244.19  |
| 2018-03-15   |   253.604 |
| 2018-04-24   |   283.272 |
| 2019-02-15   |   294.314 |
| 2017-05-26   |   326.98  |
| 2014-06-25   |   236.5   |


Table #8
Filename: source_7.csv
Sample Rows in Markdown:
| 2012-12-05   |   301.0 |
|:-------------|--------:|
| 2013-10-26   |    9804 |
| 2016-06-04   |      41 |
| 2014-05-13   |    1039 |
| 2015-06-16   |      10 |
| 2014-06-25   |     489 |
| 2015-05-15   |      20 |
| 2018-10-25   |    2382 |
| 2015-10-29   |    6488 |
| 2017-10-09   |   21420 |
| 2013-09-17   |   12997 |


Table #9
Filename: source_8.csv
Sample Rows in Markdown:
| 2012-12-05   |   20.3333 |
|:-------------|----------:|
| 2016-11-07   |      21.6 |
| 2015-10-29   |      22.9 |
| 2014-09-28   |      23.1 |
| 2019-02-15   |      23.5 |
| 2013-01-08   |      20.5 |
| 2017-08-15   |      25.9 |
| 2018-04-24   |      25.8 |
| 2016-09-18   |      23.6 |
| 2013-10-26   |      18.1 |
| 2013-09-17   |      20.2 |


Table #10
Filename: source_9.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.1646 |
|:-------------|---------:|
| 2016-03-05   | 0.032482 |
| 2018-12-19   | 0.121305 |
| 2017-05-26   | 0.21253  |
| 2015-07-27   | 0.139792 |
| 2015-03-21   | 0.208313 |
| 2014-06-25   | 0.242    |
| 2018-02-11   | 0.15177  |
| 2015-10-29   | 0.158423 |
| 2015-09-13   | 0.096771 |
| 2015-06-16   | 0.097999 |


Target Schema:
| 2012-12-05   |   301.0 |   0.0075805085 |   0.0179 |   6.9 |   0.17657143 |   20.3333 |   0.016157143 |   242.364 |   0.1646 |   0.7268 |
|:-------------|--------:|---------------:|---------:|------:|-------------:|----------:|--------------:|----------:|---------:|---------:|
| 2018-04-24   |      96 |     0.0058     | 0.004143 |   5.9 |     0.029    |      25.8 |    0.00553333 |   283.272 | 0.040874 | 0.72289  |
| 2017-08-15   |    4884 |     0.009335   | 0.055305 |  34   |     0.057    |      25.9 |    0.0034     |   175.75  | 0.151516 | 2.15243  |
| 2013-03-15   |      30 |     0.00766017 | 0.0346   |   5.5 |     0.411714 |      19.5 |    0.00978572 |   320.825 | 0.5126   | 0.8312   |
| 2014-08-12   |    1723 |     0.0033     | 0.039    |  92.5 |     0.03     |      23.8 |    0.0044     |   164     | 0.097    | 1.943    |
| 2016-03-05   |      31 |     0.04038    | 0.016863 |   7.3 |     0.024    |      22.3 |    0.0058     |   276.58  | 0.032482 | 0.922659 |
| 2016-04-28   |     187 |     0.05072    | 0.058535 |  21   |     0.031    |      25.3 |    0.0373667  |   208.64  | 0.422454 | 1.30181  |
| 2016-11-07   |   11199 |     0.0515233  | 0.015819 |  18   |     0.0655   |      21.6 |    0.0716833  |   130.37  | 0.060794 | 0.959882 |
| 2015-03-21   |     459 |     0.0082     | 0.0412   |  10.6 |     0.019    |      23   |    0.0046     |   175.57  | 0.208313 | 0.950613 |
| 2016-07-24   |   36540 |     0.0714     | 0.020928 |  10.7 |     0.026    |      23.3 |    0.1005     |   225.29  | 0.205571 | 0.77443  |
| 2017-05-26   |   15531 |     0.0217083  | 0.00866  |   5.5 |     0.015    |      25.7 |    0.0284583  |   326.98  | 0.21253  | 0.815892 |

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
source_8.csv
source_9.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
test_8.csv
test_9.csv