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


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
|   right_index | city          |   driver_count | type   |
|--------------:|:--------------|---------------:|:-------|
|             0 | Richardfort   |             38 | Urban  |
|             1 | Williamsstad  |             59 | Urban  |
|             2 | Port Angela   |             67 | Urban  |
|             3 | Rodneyfort    |             34 | Urban  |
|             4 | West Robert   |             39 | Urban  |
|             5 | West Anthony  |             70 | Urban  |
|             6 | West Angela   |             48 | Urban  |
|             7 | Martinezhaven |             25 | Urban  |
|             8 | Karenberg     |             22 | Urban  |
|             9 | Barajasview   |             26 | Urban  |


Target Schema:
| type   | city            |    fare |     ride_id |   driver_count |
|:-------|:----------------|--------:|------------:|---------------:|
| Urban  | Amandaburgh     | 23.072  | 5.0577e+12  |             12 |
| Urban  | Barajasview     | 28.7544 | 5.35362e+12 |             26 |
| Urban  | Carriemouth     | 27.2505 | 5.52208e+12 |             52 |
| Urban  | Christopherfurt | 22.5857 | 5.22576e+12 |             41 |
| Urban  | Deanville       | 24.868  | 4.86759e+12 |             49 |
| Urban  | East Kaylahaven | 22.62   | 3.97554e+12 |             65 |
| Urban  | Erikaland       | 22.5211 | 4.62514e+12 |             37 |
| Urban  | Grahamburgh     | 22.9356 | 4.07165e+12 |             61 |
| Urban  | Huntermouth     | 28.8445 | 3.9954e+12  |             37 |
| Urban  | Hurleymouth     | 26.3852 | 5.92539e+12 |             36 |

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