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:
| city          |   driver_count | type   |
|:--------------|---------------:|:-------|
| Richardfort   |             38 | Urban  |
| Williamsstad  |             59 | Urban  |
| Port Angela   |             67 | Urban  |
| Rodneyfort    |             34 | Urban  |
| West Robert   |             39 | Urban  |
| West Anthony  |             70 | Urban  |
| West Angela   |             48 | Urban  |
| Martinezhaven |             25 | Urban  |
| Karenberg     |             22 | Urban  |
| Barajasview   |             26 | Urban  |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| city                | date                |   fare |       ride_id |
|:--------------------|:--------------------|-------:|--------------:|
| Leahton             | 2018-02-28 20:02:59 |  31.01 | 2116500207936 |
| Johnton             | 2018-04-11 14:40:12 |  16.63 | 7248459450448 |
| Port David          | 2018-01-21 02:29:36 |  32.92 |  857956984195 |
| New Kimberlyborough | 2018-04-01 04:31:44 |  35.11 | 8275820093507 |
| Port Frank          | 2018-02-26 05:03:19 |  25.18 | 7280804922163 |
| Barajasview         | 2018-01-24 05:58:33 |   9.21 | 1841073494391 |
| South Phillip       | 2018-04-21 10:31:27 |  32.85 | 2752328490329 |
| North Jasmine       | 2018-04-03 13:15:16 |  19.66 | 9206122228723 |
| New Kimberlyborough | 2018-03-13 09:48:42 |  14.84 | 1839171122889 |
| North Jasmine       | 2018-01-05 16:39:33 |  26.72 | 3669060555225 |


Target Schema:
| city            |    fare |   ride_id |
|:----------------|--------:|----------:|
| Amandaburgh     | 23.072  |        15 |
| Barajasview     | 28.7544 |        16 |
| Carriemouth     | 27.2505 |        21 |
| Christopherfurt | 22.5857 |        21 |
| Deanville       | 24.868  |        15 |
| East Kaylahaven | 22.62   |        20 |
| Erikaland       | 22.5211 |         9 |
| Grahamburgh     | 22.9356 |        18 |
| Huntermouth     | 28.8445 |        20 |
| Hurleymouth     | 26.3852 |        23 |

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