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:
|       id | name                                              |   host_id | host_name             | neighbourhood_group   | neighbourhood                 |   latitude |   longitude | room_type       |   price |   minimum_nights |   number_of_reviews | last_review   | reviews_per_month   |   calculated_host_listings_count |   availability_365 |
|---------:|:--------------------------------------------------|----------:|:----------------------|:----------------------|:------------------------------|-----------:|------------:|:----------------|--------:|-----------------:|--------------------:|:--------------|:--------------------|---------------------------------:|-------------------:|
| 19035997 | Cozy Double Room in Sagrada Familia               | 118208723 | Giuseppe&Mariaclaudia | Eixample              | la Sagrada Família            |    41.4011 |     2.1754  | Private room    |      70 |                2 |                  17 | 2018-07-29    | 0.94                |                                1 |                 69 |
| 19036802 | Luminous Vintage Room near Plaza España           |   7956108 | Stephanie & Edgardo   | Sants-Montjuïc        | la Marina de Port             |    41.3645 |     2.13793 | Private room    |      25 |                2 |                  78 | 2018-11-15    | 4.37                |                                3 |                 17 |
| 19038238 | Sunny room near Plaza de Espanya                  |   7956108 | Stephanie & Edgardo   | Sants-Montjuïc        | la Font de la Guatlla         |    41.3659 |     2.13962 | Private room    |      25 |                2 |                  84 | 2018-11-18    | 4.55                |                                3 |                 17 |
| 19043388 | CENTRIC PASSEIG DE GRACIA 2-BEDROOM               |   8130906 | Arina                 | Eixample              | la Dreta de l'Eixample        |    41.3886 |     2.16959 | Entire home/apt |     316 |                3 |                   3 | 2018-06-22    | 0.17                |                               38 |                320 |
| 19043546 | Cozy single/doble room - view to Sagrada Familia! |  66517702 | Bernarda              | Eixample              | la Sagrada Família            |    41.4071 |     2.17615 | Private room    |      28 |                2 |                 102 | 2018-12-09    | 5.57                |                                2 |                 65 |
| 19043893 | Habitación centro privada con balcón barcelona    | 132917792 | Fernando              | Eixample              | Sant Antoni                   |    41.3841 |     2.16335 | Private room    |      53 |                2 |                  29 | 2018-10-28    | 1.57                |                                1 |                 36 |
| 19044613 | Single room in new Apt. Excellent location!       |  66517702 | Bernarda              | Eixample              | la Sagrada Família            |    41.4072 |     2.17824 | Private room    |      26 |                2 |                  97 | 2018-12-03    | 5.44                |                                2 |                 69 |
| 19044638 | Single room in penthouse apartment. Metro Navas   | 132346467 | Andres                | Sant Martí            | el Camp de l'Arpa del Clot    |    41.4143 |     2.18651 | Private room    |      23 |                3 |                  29 | 2018-11-15    | 1.57                |                                3 |                 91 |
| 19044796 | Habitación en Villa Olímpica                      |  77652983 | Inaki                 | Sant Martí            | la Vila Olímpica del Poblenou |    41.3936 |     2.1966  | Private room    |      30 |                2 |                  83 | 2018-11-17    | 4.59                |                                1 |                161 |
| 19045378 | Penthouse double room in Metro Navas              | 132346467 | Andres                | Sant Martí            | el Camp de l'Arpa del Clot    |    41.4156 |     2.18554 | Private room    |      53 |                1 |                   0 |               |                     |                                3 |                 90 |


Target Schema:
| neighbourhood                                |   id |   name |   host_id |   host_name |   neighbourhood_group |   latitude |   longitude |   room_type |   price |   minimum_nights |   number_of_reviews |   last_review |   reviews_per_month |   calculated_host_listings_count |   availability_365 |
|:---------------------------------------------|-----:|-------:|----------:|------------:|----------------------:|-----------:|------------:|------------:|--------:|-----------------:|--------------------:|--------------:|--------------------:|---------------------------------:|-------------------:|
| Can Baró                                     |   21 |     21 |        21 |          21 |                    21 |         21 |          21 |          21 |      21 |               21 |                  21 |            19 |                  19 |                               21 |                 21 |
| Canyelles                                    |    3 |      3 |         3 |           3 |                     3 |          3 |           3 |           3 |       3 |                3 |                   3 |             2 |                   2 |                                3 |                  3 |
| Ciutat Meridiana                             |    5 |      5 |         5 |           5 |                     5 |          5 |           5 |           5 |       5 |                5 |                   5 |             5 |                   5 |                                5 |                  5 |
| Diagonal Mar i el Front Marítim del Poblenou |  113 |    113 |       113 |         113 |                   113 |        113 |         113 |         113 |     113 |              113 |                 113 |            94 |                  94 |                              113 |                113 |
| Horta                                        |   22 |     22 |        22 |          22 |                    22 |         22 |          22 |          22 |      22 |               22 |                  22 |            21 |                  21 |                               22 |                 22 |
| Hostafrancs                                  |  122 |    122 |       122 |         122 |                   122 |        122 |         122 |         122 |     122 |              122 |                 122 |           116 |                 116 |                              122 |                122 |
| Montbau                                      |    4 |      4 |         4 |           4 |                     4 |          4 |           4 |           4 |       4 |                4 |                   4 |             3 |                   3 |                                4 |                  4 |
| Navas                                        |   38 |     38 |        38 |          38 |                    38 |         38 |          38 |          38 |      38 |               38 |                  38 |            33 |                  33 |                               38 |                 38 |
| Pedralbes                                    |   17 |     17 |        17 |          17 |                    17 |         17 |          17 |          17 |      17 |               17 |                  17 |            16 |                  16 |                               17 |                 17 |
| Porta                                        |   14 |     14 |        14 |          14 |                    14 |         14 |          14 |          14 |      14 |               14 |                  14 |             9 |                   9 |                               14 |                 14 |

Return only the final code in markdown codeblock format, without any additional text or explanation. 



target: target.csv
train: source_0.csv
test: test_0.csv