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:
| order_id                         | customer_id                      | order_status   | order_purchase_timestamp   | order_approved_at   | order_delivered_carrier_date   | order_delivered_customer_date   | order_estimated_delivery_date   |
|:---------------------------------|:---------------------------------|:---------------|:---------------------------|:--------------------|:-------------------------------|:--------------------------------|:--------------------------------|
| 9045fa841de3514ce900f5fc869d9b1f | 2f8d6af8cb3875d6964eb4b5eff3a718 | delivered      | 2017-11-21 22:34:18        | 2017-11-21 22:48:20 | 2017-11-22 20:28:57            | 2017-11-24 20:26:51             | 2017-12-13 00:00:00             |
| 1735fd3fceaea14fdd4444b0e3612a7e | addead0426117cb8aa32389bc2d0328e | delivered      | 2018-02-08 16:58:45        | 2018-02-08 17:40:22 | 2018-02-09 23:52:37            | 2018-02-22 11:52:33             | 2018-03-09 00:00:00             |
| 124282aeb36f71699a910e0670c08769 | 77089f53d5c42c03dc08dad99b373989 | delivered      | 2018-06-04 21:09:34        | 2018-06-06 03:11:05 | 2018-06-07 13:27:00            | 2018-06-15 18:58:54             | 2018-07-13 00:00:00             |
| 57fd8fedd552dd174321576bd4df11ad | f614c4aa1d48064ece3e56f6e9b43ec5 | delivered      | 2017-08-19 13:14:31        | 2017-08-20 07:04:32 | 2017-08-22 09:34:09            | 2017-08-23 18:13:20             | 2017-09-05 00:00:00             |
| 77ff15a95ac5dbc2c62ece6326365ad4 | 41643f16cc59d43e301c29258c3ea7eb | delivered      | 2017-10-04 01:16:49        | 2017-10-04 01:33:47 | 2017-10-04 18:51:19            | 2017-10-11 15:35:35             | 2017-10-31 00:00:00             |
| d360a6c1f7b7eb35282e2c574c5cbf8c | 0da103714d9838fca662d39c8335322a | delivered      | 2017-07-25 16:49:28        | 2017-07-25 17:03:23 | 2017-07-26 19:56:38            | 2017-08-05 14:47:32             | 2017-08-16 00:00:00             |
| b367cc1437c9d0b2794f759930e61eba | 719100f2027a507b233cce1b52773a90 | delivered      | 2018-04-21 09:43:04        | 2018-04-24 18:42:20 | 2018-04-23 22:28:54            | 2018-04-28 15:03:18             | 2018-05-30 00:00:00             |
| 6a9220b640ac4965f3f64a46a1f340b8 | 9d6760bac5cc8c62418cc949a05bf660 | delivered      | 2017-11-17 23:32:46        | 2017-11-17 23:46:14 | 2017-11-20 21:27:55            | 2017-12-06 00:08:38             | 2017-12-15 00:00:00             |
| 0671b2e93cae091a55f24e5b33705550 | 47e3a2dc9ad4a1a3e07f89ec91a82170 | delivered      | 2017-12-09 02:35:31        | 2017-12-12 03:55:36 | 2017-12-12 23:28:27            | 2017-12-20 18:40:20             | 2018-01-08 00:00:00             |
| c38c9bc64c50852ae814ac2dc6bff45d | b57504f62d129f5eefa6fe4a035e0e0b | delivered      | 2018-06-08 22:28:13        | 2018-06-09 07:12:19 | 2018-06-11 13:21:00            | 2018-07-07 16:48:55             | 2018-07-05 00:00:00             |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| order_id                         |   order_item_id | product_id                       | seller_id                        |   price |   freight_value |
|:---------------------------------|----------------:|:---------------------------------|:---------------------------------|--------:|----------------:|
| 9205fa5e239eb69fa652c044d52f7c0c |               1 | 0f025e441822f059a260a6ec3001ec0e | 609e1a9a6c2539919b8205cf7c4e6ff0 |   45.9  |           18.23 |
| bce3ba299a4d73c52b90686a13c29a57 |               1 | 3dd2a17168ec895c781a9191c1e95ad7 | de722cd6dad950a92b7d4f82673f8833 |  149.9  |           27.59 |
| 9c074b1d5c9fcaa13fdea5c761dca404 |               1 | 4aa6014eceb682077f9dc4bffebc05b0 | b8bc237ba3788b23da09c0f1f3a3288c |  294.99 |           31.1  |
| c78ebbd697d902b76f0b9381f22b17cd |               2 | d1c427060a0f73f6b889a5c7c61f2ac4 | a1043bafd471dff536d0c462352beb48 |  119    |            7.64 |
| b1cc3e65937e4d01bff18495b5577f57 |               1 | 74e5e7c0ad09d8fec4d30c75a70a7799 | 3db66a856d18a9cba7c9241fc5221c50 |   69.9  |           14.22 |
| aa14b8f4567fef1be1a8912ca010f1c7 |               2 | 6f58f28210b611d0907de2b23c2e78a9 | 1835b56ce799e6a4dc4eddc053f04066 |   26.99 |            2.54 |
| be2d17e0af05916e706b4d0ea44154ec |               1 | 4100a608bd0aa524b06ffefba973707b | 2a61c271b1ac763450d846849783e922 |   32.99 |           15.1  |
| b37a7be6fbd41461b87deafd8b902cc6 |               1 | aff39c649de8c4e36d325880de8f4338 | 3ade81dab5a172b88e1871c28ae05260 |  185    |           25.6  |
| 843987ad16fdca324fc74eb57896cee2 |               1 | f4a38926843e01497a3f63a5d5740c72 | 8b321bb669392f5163d04c59e235e066 |   13.65 |           15.1  |
| 80176445f6976a30f014195eb46053c1 |               5 | 30ac6df06dc59ad72cf2f158fc2d904c | 0dd184061fb0eaa7ca37932c68ab91c5 |  120    |           48.28 |


Target Schema:
| order_id                         | order_status   | order_approved_at   | product_id                       | seller_id                        |   price |   freight_value |
|:---------------------------------|:---------------|:--------------------|:---------------------------------|:---------------------------------|--------:|----------------:|
| 53cdb2fc8bc7dce0b6741e2150273451 | delivered      | 2018-07-26 03:24:27 | 595fac2a385ac33a80bd5114aec74eb8 | 289cdb325fb7e7f891c38608bf9e0962 |  118.7  |           22.76 |
| 47770eb9100c2d0c44946d9cf07ec65d | delivered      | 2018-08-08 08:55:23 | aa4383b373c6aca5d8797843e5594415 | 4869f7a5dfa277a7dca6462dcf3b52b2 |  159.9  |           19.22 |
| 136cce7faa42fdb2cefd53fdc79a6098 | invoiced       | 2017-04-13 13:25:17 | a1804276d9941ac0733cfd409f5206eb | dc8798cbf453b7e0f98745e396cc5616 |   49.9  |           16.05 |
| 6514b8ad8028c9f2cc2374ded245783f | delivered      | 2017-05-16 13:22:11 | 4520766ec412348b8d4caa5e8a18c464 | 16090f2ca825584b5a147ab24aa30c86 |   59.99 |           15.17 |
| 76c6e866289321a7c93b82b54852dc33 | delivered      | 2017-01-25 02:50:47 | ac1789e492dcd698c5c10b97a671243a | 63b9ae557efed31d1f7687917d248a8d |   19.9  |           16.05 |
| 34513ce0c4fab462a55830c0989c7edb | delivered      | 2017-07-13 20:10:08 | f7e0fa615b386bc9a8b9eb52bc1fff76 | 87142160b41353c4e5fca2360caf6f92 |   98    |           16.13 |
| 5ff96c15d0b717ac6ad1f3d77225a350 | delivered      | 2018-07-25 17:55:14 | 10adb53d8faa890ca7c2f0cbcb68d777 | 1900267e848ceeba8fa32d80c1a5f5a8 |   19.9  |           12.8  |
| 432aaf21d85167c2c86ec9448c4e42cc | delivered      | 2018-03-01 15:10:47 | 72d3bf1d3a790f8874096fcf860e3eff | 0bae85eb84b9fb3bd773911e89288d54 |   38.25 |           16.11 |
| 403b97836b0c04a622354cf531062e5f | delivered      | 2018-01-02 19:09:04 | 638bbb2a5e4f360b71f332ddfebfd672 | c4af86330efa7a2620772227d2d670c9 | 1299    |           77.45 |
| 116f0b09343b49556bbad5f35bee0cdf | delivered      | 2017-12-26 23:50:22 | a47295965bd091207681b541b26e40a5 | ea8482cd71df3c1969d7b9473ff13abc |   27.99 |           15.1  |

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