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.016157143 |
|:-------------|--------------:|
| 2017-07-03   |    0.01405    |
| 2013-03-15   |    0.00978572 |
| 2015-03-21   |    0.0046     |
| 2017-03-14   |    0.057275   |
| 2013-08-23   |    0.0089     |
| 2014-05-13   |    0.00666667 |
| 2017-08-15   |    0.0034     |
| 2015-10-29   |    0.0126     |
| 2015-06-16   |    0.0049     |
| 2018-04-24   |    0.00553333 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| 2012-12-05   |   242.364 |
|:-------------|----------:|
| 2015-03-21   |   175.57  |
| 2017-05-26   |   326.98  |
| 2013-03-15   |   320.825 |
| 2018-06-07   |   319.76  |
| 2014-03-25   |   198     |
| 2019-02-15   |   294.314 |
| 2014-09-28   |   128.3   |
| 2016-07-24   |   225.29  |
| 2017-07-03   |   132.47  |
| 2015-07-27   |   163.97  |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| 2012-12-05   |   301.0 |
|:-------------|--------:|
| 2014-08-12   |    1723 |
| 2014-06-25   |     489 |
| 2014-09-28   |    4611 |
| 2015-09-13   |    5475 |
| 2013-09-17   |   12997 |
| 2016-07-24   |   36540 |
| 2014-05-13   |    1039 |
| 2019-02-15   |      20 |
| 2018-03-15   |      85 |
| 2017-05-26   |   15531 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.0075805085 |
|:-------------|---------------:|
| 2017-07-03   |     0.01177    |
| 2015-10-29   |     0.03004    |
| 2017-05-26   |     0.0217083  |
| 2015-06-16   |     0.0078     |
| 2017-03-14   |     0.041585   |
| 2014-03-25   |     0.00605    |
| 2018-02-11   |     0.00653333 |
| 2013-06-28   |     0.0077     |
| 2014-09-28   |     0.00575    |
| 2016-03-05   |     0.04038    |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| 2012-12-05   |   20.3333 |
|:-------------|----------:|
| 2017-04-23   |      30.1 |
| 2018-02-11   |      20.7 |
| 2015-07-27   |      25.9 |
| 2014-06-25   |      24   |
| 2013-10-26   |      18.1 |
| 2013-03-15   |      19.5 |
| 2013-01-08   |      20.5 |
| 2013-06-28   |      25.3 |
| 2016-06-04   |      26.5 |
| 2014-03-25   |      23.5 |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.1646 |
|:-------------|---------:|
| 2015-10-29   | 0.158423 |
| 2014-09-28   | 0.178    |
| 2017-05-26   | 0.21253  |
| 2015-03-21   | 0.208313 |
| 2014-02-26   | 0.279    |
| 2013-09-17   | 0.0844   |
| 2015-05-15   | 0.31901  |
| 2014-06-25   | 0.242    |
| 2013-08-23   | 0.0702   |
| 2017-07-03   | 0.931213 |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
| 2012-12-05   |   6.9 |
|:-------------|------:|
| 2014-09-28   |  36   |
| 2019-02-15   |   9.5 |
| 2013-09-17   | 112.5 |
| 2017-10-09   |  90   |
| 2015-03-21   |  10.6 |
| 2016-07-24   |  10.7 |
| 2014-05-13   |   6.5 |
| 2016-04-28   |  21   |
| 2013-10-26   |  39   |
| 2013-06-28   |   4.5 |


Table #8
Filename: source_7.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.0179 |
|:-------------|---------:|
| 2013-09-17   | 0.0373   |
| 2017-10-09   | 0.0175   |
| 2014-08-12   | 0.039    |
| 2016-07-24   | 0.020928 |
| 2019-02-15   | 0.002813 |
| 2014-09-28   | 0.03     |
| 2014-03-25   | 0.004    |
| 2014-02-26   | 0.016    |
| 2015-06-16   | 0.002875 |
| 2017-07-03   | 0.188686 |


Table #9
Filename: source_8.csv
Sample Rows in Markdown:
| 2012-12-05   |   0.17657143 |
|:-------------|-------------:|
| 2015-03-21   |     0.019    |
| 2014-03-25   |     0.028    |
| 2016-04-28   |     0.031    |
| 2013-06-28   |     0.529286 |
| 2015-10-29   |     0.127    |
| 2018-03-15   |     0.01     |
| 2019-02-15   |     0.053    |
| 2014-08-12   |     0.03     |
| 2013-10-26   |     0.882    |
| 2018-10-25   |     0.12     |


Target Schema:
| 2012-12-05   |   301.0 |   0.0075805085 |   0.0179 |   6.9 |   0.17657143 |   20.3333 |   0.016157143 |   242.364 |   0.1646 |
|:-------------|--------:|---------------:|---------:|------:|-------------:|----------:|--------------:|----------:|---------:|
| 2014-02-26   |   24196 |     0.00696667 | 0.016    |   2   |    0.063     |      21.2 |    0.00893333 |   324.9   | 0.279    |
| 2016-03-05   |      31 |     0.04038    | 0.016863 |   7.3 |    0.024     |      22.3 |    0.0058     |   276.58  | 0.032482 |
| 2018-04-24   |      96 |     0.0058     | 0.004143 |   5.9 |    0.029     |      25.8 |    0.00553333 |   283.272 | 0.040874 |
| 2018-10-25   |    2382 |     0.00506667 | 0.03646  |  20   |    0.12      |      22   |    0.0032     |   125.879 | 0.161588 |
| 2017-10-09   |   21420 |     0.0069     | 0.0175   |  90   |    0.023     |      21.7 |    0.0099     |   122.94  | 0.37377  |
| 2015-06-16   |      10 |     0.0078     | 0.002875 |   5.1 |    0.0186667 |      25.8 |    0.0049     |   244.19  | 0.097999 |
| 2018-06-07   |      10 |     0.00543333 | 0.002905 |   7.3 |    0.048     |      27.3 |    0.00436667 |   319.76  | 0.101231 |
| 2016-04-28   |     187 |     0.05072    | 0.058535 |  21   |    0.031     |      25.3 |    0.0373667  |   208.64  | 0.422454 |
| 2013-10-26   |    9804 |     0.00788333 | 0.037    |  39   |    0.882     |      18.1 |    0.0100667  |   163.956 | 0.008    |
| 2013-01-08   |     473 |     0.00762034 | 0.0203   |   3.5 |    0.294143  |      20.5 |    0.0129714  |   235.524 | 0.2486   |

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