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:
|           tweet_id | in_reply_to_status_id   | in_reply_to_user_id   | timestamp                 | source                                                                             | text                                                                                                                                           | retweeted_status_id   | retweeted_status_user_id   | retweeted_status_timestamp   | expanded_urls                                                                                                                   |   rating_numerator |   rating_denominator | name    | doggo   | floofer   | pupper   | puppo   |
|-------------------:|:------------------------|:----------------------|:--------------------------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|:----------------------|:---------------------------|:-----------------------------|:--------------------------------------------------------------------------------------------------------------------------------|-------------------:|---------------------:|:--------|:--------|:----------|:---------|:--------|
| 719551379208073216 |                         |                       | 2016-04-11 15:43:12 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | This is Harnold. He accidentally opened the front facing camera. 10/10 get it together Harnold https://t.co/S6JHaSMtln                         |                       |                            |                              | https://twitter.com/dog_rates/status/719551379208073216/photo/1                                                                 |                 10 |                   10 | Harnold | None    | None      | None     | None    |
| 719367763014393856 |                         |                       | 2016-04-11 03:33:34 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | Meet Sid &amp; Murphy. Murphy floats alongside Sid and whispers motivational quotes in his ear. Magical af. Both 11/10 https://t.co/7mmjyearQW |                       |                            |                              | https://twitter.com/dog_rates/status/719367763014393856/photo/1                                                                 |                 11 |                   10 | Sid     | None    | None      | None     | None    |
| 719339463458033665 |                         |                       | 2016-04-11 01:41:07 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | Say hello to Lucy and Sophie. They think they're the same size. Both 10/10 would snug at same time https://t.co/HW50zkcf2R                     |                       |                            |                              | https://twitter.com/dog_rates/status/719339463458033665/photo/1                                                                 |                 10 |                   10 | Lucy    | None    | None      | None     | None    |
| 719332531645071360 |                         |                       | 2016-04-11 01:13:34 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | This is Pippa. She managed to start the car but is waiting for you to buckle up before driving. Responsible af 11/10 https://t.co/htrlmC7saz   |                       |                            |                              | https://twitter.com/dog_rates/status/719332531645071360/photo/1                                                                 |                 11 |                   10 | Pippa   | None    | None      | None     | None    |
| 718971898235854848 |                         |                       | 2016-04-10 01:20:33 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | This is Sadie. She is prepared for battle. 10/10 https://t.co/JRckDkZVRT                                                                       |                       |                            |                              | https://twitter.com/dog_rates/status/718971898235854848/photo/1                                                                 |                 10 |                   10 | Sadie   | None    | None      | None     | None    |
| 718939241951195136 |                         |                       | 2016-04-09 23:10:47 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | This is Otis. Everybody look at Otis. 12/10 would probably faint while petting https://t.co/I9qoe1uEih                                         |                       |                            |                              | https://twitter.com/dog_rates/status/718939241951195136/photo/1                                                                 |                 12 |                   10 | Otis    | None    | None      | None     | None    |
| 718631497683582976 |                         |                       | 2016-04-09 02:47:55 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | We normally don't rate marshmallows but this one appears to be flawlessly toasted so I'll make an exception. 10/10 https://t.co/D9jbbmPmos     |                       |                            |                              | https://twitter.com/dog_rates/status/718631497683582976/photo/1                                                                 |                 10 |                   10 | None    | None    | None      | None     | None    |
| 718613305783398402 |                         |                       | 2016-04-09 01:35:37 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | This is Carper. He's a Tortellini Angiosperm. In desperate need of a petting. 11/10 would hug softly https://t.co/lK9YDkRzPj                   |                       |                            |                              | https://twitter.com/dog_rates/status/718613305783398402/photo/1                                                                 |                 11 |                   10 | Carper  | None    | None      | None     | None    |
| 718540630683709445 |                         |                       | 2016-04-08 20:46:50 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | Get you a pup that can do both. 10/10 https://t.co/zSbyvm62xZ                                                                                  |                       |                            |                              | https://twitter.com/dog_rates/status/718540630683709445/photo/1,https://twitter.com/dog_rates/status/718540630683709445/photo/1 |                 10 |                   10 | None    | None    | None      | None     | None    |
| 718460005985447936 |                         |                       | 2016-04-08 15:26:28 +0000 | <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | Meet Bowie. He's listening for underground squirrels. Smart af. Left eye is considerably magical. 9/10 would so pet https://t.co/JyNmyjy3fe    |                       |                            |                              | https://twitter.com/dog_rates/status/718460005985447936/photo/1                                                                 |                  9 |                   10 | Bowie   | None    | None      | None     | None    |


Target Schema:
|   dog_type |
|-----------:|
|       4471 |
|        107 |
|         96 |
|         30 |
|          8 |

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