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.0179 |
|:-------------|---------:|
| 2017-07-03   | 0.188686 |
| 2018-12-19   | 0.02123  |
| 2013-06-28   | 0.032    |
| 2017-08-15   | 0.055305 |
| 2018-03-15   | 0.037418 |
| 2016-03-05   | 0.016863 |
| 2015-03-21   | 0.0412   |
| 2018-10-25   | 0.03646  |
| 2017-04-23   | 0.00295  |
| 2017-03-14   | 0.02533  |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| 2012-12-05   |   301.0 |
|:-------------|--------:|
| 2015-07-27   |     496 |
| 2018-02-11   |      74 |
| 2014-02-26   |   24196 |
| 2013-10-26   |    9804 |
| 2018-12-19   |      41 |
| 2017-05-26   |   15531 |
| 2015-05-15   |      20 |
| 2016-09-18   |      52 |
| 2017-03-14   |    5609 |
| 2018-10-25   |    2382 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| 2012-12-05   |   242.364 |
|:-------------|----------:|
| 2013-09-17   |   175.829 |
| 2017-04-23   |   325.71  |
| 2018-12-19   |   231.883 |
| 2015-05-15   |   232.18  |
| 2017-05-26   |   326.98  |
| 2018-10-25   |   125.879 |
| 2016-11-07   |   130.37  |
| 2015-10-29   |   149.76  |
| 2017-10-09   |   122.94  |
| 2015-07-27   |   163.97  |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.016157143 |
|:-------------|--------------:|
| 2016-11-07   |     0.0716833 |
| 2015-07-27   |     0.0144    |
| 2014-08-12   |     0.0044    |
| 2015-06-16   |     0.0049    |
| 2017-08-15   |     0.0034    |
| 2013-09-17   |     0.0112    |
| 2018-10-25   |     0.0032    |
| 2017-07-03   |     0.01405   |
| 2013-08-23   |     0.0089    |
| 2014-09-28   |     0.0045    |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.17657143 |
|:-------------|-------------:|
| 2013-08-23   |     0.646857 |
| 2014-03-25   |     0.028    |
| 2013-09-17   |     0.764429 |
| 2018-10-25   |     0.12     |
| 2017-08-15   |     0.057    |
| 2018-04-24   |     0.029    |
| 2017-10-09   |     0.023    |
| 2013-01-08   |     0.294143 |
| 2017-07-03   |     0.058    |
| 2015-09-13   |     0.022    |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| 2012-12-05   |   20.3333 |
|:-------------|----------:|
| 2017-07-03   |      23.2 |
| 2014-03-25   |      23.5 |
| 2015-10-29   |      22.9 |
| 2018-04-24   |      25.8 |
| 2016-04-28   |      25.3 |
| 2016-11-07   |      21.6 |
| 2015-05-15   |      25.3 |
| 2019-02-15   |      23.5 |
| 2013-03-15   |      19.5 |
| 2014-06-25   |      24   |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
| 2012-12-05   |   6.9 |
|:-------------|------:|
| 2017-10-09   |  90   |
| 2016-04-28   |  21   |
| 2013-01-08   |   3.5 |
| 2015-10-29   |  48   |
| 2016-07-24   |  10.7 |
| 2017-03-14   |   5.7 |
| 2018-02-11   |   4.1 |
| 2018-12-19   |   4.8 |
| 2014-02-26   |   2   |
| 2015-03-21   |  10.6 |


Table #8
Filename: source_7.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.0075805085 |
|:-------------|---------------:|
| 2013-01-08   |     0.00762034 |
| 2015-07-27   |     0.0076     |
| 2014-09-28   |     0.00575    |
| 2018-12-19   |     0.0047     |
| 2016-06-04   |     0.06106    |
| 2014-05-13   |     0.00513333 |
| 2013-08-23   |     0.00825    |
| 2016-04-28   |     0.05072    |
| 2014-03-25   |     0.00605    |
| 2014-08-12   |     0.0033     |


Target Schema:
| 2012-12-05   |   301.0 |   0.0075805085 |   0.0179 |   6.9 |   0.17657143 |   20.3333 |   0.016157143 |   242.364 |
|:-------------|--------:|---------------:|---------:|------:|-------------:|----------:|--------------:|----------:|
| 2014-03-25   |     171 |      0.00605   | 0.004    |   2.8 |     0.028    |      23.5 |     0.0078    |   198     |
| 2016-11-07   |   11199 |      0.0515233 | 0.015819 |  18   |     0.0655   |      21.6 |     0.0716833 |   130.37  |
| 2015-09-13   |    5475 |      0.0197    | 0.030934 |  90   |     0.022    |      22.1 |     0.0347    |   154.71  |
| 2017-07-03   |   11300 |      0.01177   | 0.188686 | 150   |     0.058    |      23.2 |     0.01405   |   132.47  |
| 2016-07-24   |   36540 |      0.0714    | 0.020928 |  10.7 |     0.026    |      23.3 |     0.1005    |   225.29  |
| 2016-03-05   |      31 |      0.04038   | 0.016863 |   7.3 |     0.024    |      22.3 |     0.0058    |   276.58  |
| 2016-06-04   |      41 |      0.06106   | 0.001835 |   5.4 |     0.063    |      26.5 |     0.0689333 |   280.24  |
| 2013-09-17   |   12997 |      0.0088    | 0.0373   | 112.5 |     0.764429 |      20.2 |     0.0112    |   175.829 |
| 2017-10-09   |   21420 |      0.0069    | 0.0175   |  90   |     0.023    |      21.7 |     0.0099    |   122.94  |
| 2016-04-28   |     187 |      0.05072   | 0.058535 |  21   |     0.031    |      25.3 |     0.0373667 |   208.64  |

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
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