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.0075805085 |
|:-------------|---------------:|
| 2018-02-11   |     0.00653333 |
| 2017-04-23   |     0.0316467  |
| 2014-03-25   |     0.00605    |
| 2015-07-27   |     0.0076     |
| 2015-10-29   |     0.03004    |
| 2017-05-26   |     0.0217083  |
| 2017-03-14   |     0.041585   |
| 2014-06-25   |     0.00421667 |
| 2015-03-21   |     0.0082     |
| 2013-08-23   |     0.00825    |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.016157143 |
|:-------------|--------------:|
| 2018-06-07   |    0.00436667 |
| 2017-10-09   |    0.0099     |
| 2016-04-28   |    0.0373667  |
| 2017-08-15   |    0.0034     |
| 2017-03-14   |    0.057275   |
| 2013-03-15   |    0.00978572 |
| 2016-11-07   |    0.0716833  |
| 2015-06-16   |    0.0049     |
| 2013-06-28   |    0.0066     |
| 2015-09-13   |    0.0347     |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| 2012-12-05   |   6.9 |
|:-------------|------:|
| 2015-09-13   |  90   |
| 2014-03-25   |   2.8 |
| 2013-03-15   |   5.5 |
| 2015-07-27   |  52   |
| 2016-07-24   |  10.7 |
| 2014-09-28   |  36   |
| 2016-11-07   |  18   |
| 2017-03-14   |   5.7 |
| 2013-08-23   |   4   |
| 2015-03-21   |  10.6 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| 2012-12-05   |   20.3333 |
|:-------------|----------:|
| 2016-03-05   |      22.3 |
| 2014-02-26   |      21.2 |
| 2018-04-24   |      25.8 |
| 2017-05-26   |      25.7 |
| 2014-06-25   |      24   |
| 2013-08-23   |      24.5 |
| 2014-03-25   |      23.5 |
| 2019-02-15   |      23.5 |
| 2018-03-15   |      21.6 |
| 2013-01-08   |      20.5 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| 2012-12-05   |   301.0 |
|:-------------|--------:|
| 2018-02-11   |      74 |
| 2018-04-24   |      96 |
| 2017-04-23   |      20 |
| 2018-10-25   |    2382 |
| 2013-01-08   |     473 |
| 2016-11-07   |   11199 |
| 2015-05-15   |      20 |
| 2017-07-03   |   11300 |
| 2013-06-28   |     201 |
| 2016-04-28   |     187 |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.0179 |
|:-------------|---------:|
| 2016-03-05   | 0.016863 |
| 2014-09-28   | 0.03     |
| 2014-05-13   | 0.005    |
| 2014-03-25   | 0.004    |
| 2013-06-28   | 0.032    |
| 2015-09-13   | 0.030934 |
| 2018-06-07   | 0.002905 |
| 2016-09-18   | 0.04548  |
| 2017-10-09   | 0.0175   |
| 2018-03-15   | 0.037418 |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.17657143 |
|:-------------|-------------:|
| 2014-05-13   |    0.011     |
| 2014-02-26   |    0.063     |
| 2013-10-26   |    0.882     |
| 2015-06-16   |    0.0186667 |
| 2015-07-27   |    0.0203333 |
| 2015-09-13   |    0.022     |
| 2016-07-24   |    0.026     |
| 2016-04-28   |    0.031     |
| 2018-02-11   |    0.11      |
| 2015-05-15   |    0.017     |


Target Schema:
| 2012-12-05   |   301.0 |   0.0075805085 |   0.0179 |   6.9 |   0.17657143 |   20.3333 |   0.016157143 |
|:-------------|--------:|---------------:|---------:|------:|-------------:|----------:|--------------:|
| 2014-06-25   |     489 |     0.00421667 | 0.029    |   2.5 |    0.0205    |      24   |    0.00553333 |
| 2019-02-15   |      20 |     0.03217    | 0.002813 |   9.5 |    0.053     |      23.5 |    0.00733714 |
| 2015-06-16   |      10 |     0.0078     | 0.002875 |   5.1 |    0.0186667 |      25.8 |    0.0049     |
| 2014-09-28   |    4611 |     0.00575    | 0.03     |  36   |    0.051     |      23.1 |    0.0045     |
| 2016-06-04   |      41 |     0.06106    | 0.001835 |   5.4 |    0.063     |      26.5 |    0.0689333  |
| 2018-06-07   |      10 |     0.00543333 | 0.002905 |   7.3 |    0.048     |      27.3 |    0.00436667 |
| 2013-08-23   |      20 |     0.00825    | 0.0243   |   4   |    0.646857  |      24.5 |    0.0089     |
| 2017-03-14   |    5609 |     0.041585   | 0.02533  |   5.7 |    0.068     |      19.9 |    0.057275   |
| 2017-08-15   |    4884 |     0.009335   | 0.055305 |  34   |    0.057     |      25.9 |    0.0034     |
| 2014-05-13   |    1039 |     0.00513333 | 0.005    |   6.5 |    0.011     |      26   |    0.00666667 |

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