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:
|   business_id | Score   |     date | type                  |
|--------------:|:--------|---------:|:----------------------|
|         68013 | 100.0   | 20140514 | Routine - Unscheduled |
|         66687 | 100.0   | 20141007 | Routine - Unscheduled |
|         34708 | 90.0    | 20141009 | Routine - Unscheduled |
|         83351 | 77.0    | 20160316 | Routine - Unscheduled |
|         70983 | 86.0    | 20130708 | Routine - Unscheduled |
|         68650 | 98.0    | 20130416 | Routine - Unscheduled |
|         65692 | 90.0    | 20140515 | Routine - Unscheduled |
|         74517 | 96.0    | 20140730 | Routine - Unscheduled |
|          2764 |         | 20130528 | Reinspection/Followup |
|         33911 |         | 20150311 | Complaint             |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
|   business_id |     date |   ViolationTypeID | risk_category   | description                                                |
|--------------:|---------:|------------------:|:----------------|:-----------------------------------------------------------|
|         35464 | 20140721 |            103131 | Moderate Risk   | Moderate risk vermin infestation                           |
|         35464 | 20140721 |            103154 | Low Risk        | Unclean or degraded floors walls or ceilings               |
|         35464 | 20130625 |            103144 | Low Risk        | Unapproved or unmaintained equipment or utensils           |
|         35464 | 20130625 |            103124 | Moderate Risk   | Inadequately cleaned or sanitized food contact surfaces    |
|         35464 | 20150709 |            103154 | Low Risk        | Unclean or degraded floors walls or ceilings               |
|         35464 | 20150709 |            103120 | Moderate Risk   | Moderate risk food holding temperature                     |
|         35469 | 20140513 |            103120 | Moderate Risk   | Moderate risk food holding temperature                     |
|         35469 | 20140513 |            103135 | Low Risk        | No person in charge of food facility                       |
|         35469 | 20140513 |            103138 | Low Risk        | Improper storage use or identification of toxic substances |
|         35469 | 20140513 |            103145 | Low Risk        | Improper storage of equipment utensils or linens           |


Target Schema:
|   business_id |   Score |     date | type                  |   ViolationTypeID | risk_category   | description                                                               |
|--------------:|--------:|---------:|:----------------------|------------------:|:----------------|:--------------------------------------------------------------------------|
|            10 |      94 | 20140729 | Routine - Unscheduled |            103129 | Moderate Risk   | Insufficient hot water or running water                                   |
|            10 |      94 | 20140729 | Routine - Unscheduled |            103144 | Low Risk        | Unapproved or unmaintained equipment or utensils                          |
|            10 |      92 | 20140114 | Routine - Unscheduled |            103154 | Low Risk        | Unclean or degraded floors walls or ceilings                              |
|            10 |      92 | 20140114 | Routine - Unscheduled |            103119 | Moderate Risk   | Inadequate and inaccessible handwashing facilities                        |
|            10 |      92 | 20140114 | Routine - Unscheduled |            103145 | Low Risk        | Improper storage of equipment utensils or linens                          |
|            19 |      94 | 20141110 | Routine - Unscheduled |            103145 | Low Risk        | Improper storage of equipment utensils or linens                          |
|            19 |      94 | 20141110 | Routine - Unscheduled |            103116 | Moderate Risk   | Inadequate food safety knowledge or lack of certified food safety manager |
|            19 |      94 | 20140214 | Routine - Unscheduled |            103156 | Low Risk        | Permit license or inspection report not posted                            |
|            19 |      94 | 20140214 | Routine - Unscheduled |            103124 | Moderate Risk   | Inadequately cleaned or sanitized food contact surfaces                   |
|            19 |      96 | 20130904 | Routine - Unscheduled |            103133 | Moderate Risk   | Foods not protected from contamination                                    |

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