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:
| Postalcode   | Borough         | Neighborhood                                          |
|:-------------|:----------------|:------------------------------------------------------|
| M1N          | Scarborough     | Birch Cliff, Cliffside West                           |
| M2N          | North York      | Willowdale, Willowdale East                           |
| M3N          | North York      | Downsview                                             |
| M4N          | Central Toronto | Lawrence Park                                         |
| M5N          | Central Toronto | Roselawn                                              |
| M6N          | York            | Runnymede, The Junction North                         |
| M7N          | Not assigned    | Not assigned                                          |
| M8N          | Not assigned    | Not assigned                                          |
| M9N          | York            | Weston                                                |
| M1P          | Scarborough     | Dorset Park, Wexford Heights, Scarborough Town Centre |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| Postalcode   |   Latitude |   Longitude |
|:-------------|-----------:|------------:|
| M1B          |    43.8067 |    -79.1944 |
| M1C          |    43.7845 |    -79.1605 |
| M1E          |    43.7636 |    -79.1887 |
| M1G          |    43.771  |    -79.2169 |
| M1H          |    43.7731 |    -79.2395 |
| M1J          |    43.7447 |    -79.2395 |
| M1K          |    43.7279 |    -79.262  |
| M1L          |    43.7111 |    -79.2846 |
| M1M          |    43.7163 |    -79.2395 |
| M1N          |    43.6927 |    -79.2648 |


Target Schema:
| Postalcode   |   Latitude |   Longitude | Borough     | Neighborhood                                    | Neighborhood_joined                             |
|:-------------|-----------:|------------:|:------------|:------------------------------------------------|:------------------------------------------------|
| M1B          |    43.8067 |    -79.1944 | Scarborough | Malvern, Rouge                                  | Malvern, Rouge                                  |
| M1C          |    43.7845 |    -79.1605 | Scarborough | Rouge Hill, Port Union, Highland Creek          | Rouge Hill, Port Union, Highland Creek          |
| M1E          |    43.7636 |    -79.1887 | Scarborough | Guildwood, Morningside, West Hill               | Guildwood, Morningside, West Hill               |
| M1G          |    43.771  |    -79.2169 | Scarborough | Woburn                                          | Woburn                                          |
| M1H          |    43.7731 |    -79.2395 | Scarborough | Cedarbrae                                       | Cedarbrae                                       |
| M1J          |    43.7447 |    -79.2395 | Scarborough | Scarborough Village                             | Scarborough Village                             |
| M1K          |    43.7279 |    -79.262  | Scarborough | Kennedy Park, Ionview, East Birchmount Park     | Kennedy Park, Ionview, East Birchmount Park     |
| M1L          |    43.7111 |    -79.2846 | Scarborough | Golden Mile, Clairlea, Oakridge                 | Golden Mile, Clairlea, Oakridge                 |
| M1M          |    43.7163 |    -79.2395 | Scarborough | Cliffside, Cliffcrest, Scarborough Village West | Cliffside, Cliffcrest, Scarborough Village West |
| M2H          |    43.8038 |    -79.3635 | North York  | Hillcrest Village                               | Hillcrest Village                               |

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