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:
| ORDERNUMBER                                                                                                                                                                                                                            | QUANTITYORDERED   | PRICEEACH   | ORDERLINENUMBER   | SALES   | ORDERDATE       | STATUS   | QTR_ID   | MONTH_ID   | YEAR_ID   | PRODUCTLINE   | MSRP   | PRODUCTCODE   | CUSTOMERNAME                 | PHONE      | ADDRESSLINE1        | ADDRESSLINE2   | CITY        | STATE   | POSTALCODE   | COUNTRY   | TERRITORY   | CONTACTLASTNAME   | CONTACTFIRSTNAME   | DEALSIZE   |
|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:------------|:------------------|:--------|:----------------|:---------|:---------|:-----------|:----------|:--------------|:-------|:--------------|:-----------------------------|:-----------|:--------------------|:---------------|:------------|:--------|:-------------|:----------|:------------|:------------------|:-------------------|:-----------|
| 10367                                                                                                                                                                                                                                  | 44.0              | 85.25       | 9.0               | 3751.0  | 1/12/2005 0:00  | Resolved | 1.0      | 1.0        | 2005.0    | Classic Cars  | 71.0   | S18_4933      | Toys4GrownUps.com            | 6265557265 | 78934 Hillside Dr.  |                | Pasadena    | CA      | 90003        | USA       |             | Young             | Julie              | Medium     |
| 10380,24,100,2,4536,2/16/2005 0:00,Shipped,1,2,2005,Classic Cars,71,S18_4933,Euro Shopping Channel,(91) 555 94 44,"C/ Moralzarzal, 86",,Madrid,,28034,Spain,EMEA,Freyre,Diego,Medium                                                   |                   |             |                   |         |                 |          |          |            |           |               |        |               |                              |            |                     |                |             |         |              |           |             |                   |                    |            |
| 10407                                                                                                                                                                                                                                  | 66.0              | 66.99       | 4.0               | 4421.34 | 4/22/2005 0:00  | On Hold  | 2.0      | 4.0        | 2005.0    | Classic Cars  | 71.0   | S18_4933      | The Sharp Gifts Warehouse    | 4085553659 | 3086 Ingle Ln.      |                | San Jose    | CA      | 94217        | USA       |             | Frick             | Sue                | Medium     |
| 10420,36,57.73,7,2078.28,5/29/2005 0:00,In Process,2,5,2005,Classic Cars,71,S18_4933,Souveniers And Things Co.,+61 2 9495 8555,"Monitor Money Building, 815 Pacific Hwy",Level 6,Chatswood,NSW,2067,Australia,APAC,Huxley,Adrian,Small |                   |             |                   |         |                 |          |          |            |           |               |        |               |                              |            |                     |                |             |         |              |           |             |                   |                    |            |
| 10110,36,85.25,13,3069,3/18/2003 0:00,Shipped,1,3,2003,Classic Cars,73,S24_1046,"AV Stores, Co.",(171) 555-1555,Fauntleroy Circus,,Manchester,,EC2 5NT,UK,EMEA,Ashworth,Victoria,Medium                                                |                   |             |                   |         |                 |          |          |            |           |               |        |               |                              |            |                     |                |             |         |              |           |             |                   |                    |            |
| 10124                                                                                                                                                                                                                                  | 22.0              | 77.9        | 12.0              | 1713.8  | 5/21/2003 0:00  | Shipped  | 2.0      | 5.0        | 2003.0    | Classic Cars  | 73.0   | S24_1046      | Signal Gift Stores           | 7025551838 | 8489 Strong St.     |                | Las Vegas   | NV      | 83030        | USA       |             | King              | Sue                | Small      |
| 10148,25,60.26,6,1506.5,9/11/2003 0:00,Shipped,3,9,2003,Classic Cars,73,S24_1046,"Anna's Decorations, Ltd",02 9936 8555,201 Miller Street,Level 15,North Sydney,NSW,2060,Australia,APAC,O'Hara,Anna,Small                              |                   |             |                   |         |                 |          |          |            |           |               |        |               |                              |            |                     |                |             |         |              |           |             |                   |                    |            |
| 10161                                                                                                                                                                                                                                  | 37.0              | 72.76       | 5.0               | 2692.12 | 10/17/2003 0:00 | Shipped  | 4.0      | 10.0       | 2003.0    | Classic Cars  | 73.0   | S24_1046      | Heintze Collectables         | 86 21 3555 | Smagsloget 45       |                | Aaarhus     |         | 8200         | Denmark   | EMEA        | Ibsen             | Palle              | Small      |
| 10172                                                                                                                                                                                                                                  | 32.0              | 75.69       | 3.0               | 2422.08 | 11/5/2003 0:00  | Shipped  | 4.0      | 11.0       | 2003.0    | Classic Cars  | 73.0   | S24_1046      | Gift Depot Inc.              | 2035552570 | 25593 South Bay Ln. |                | Bridgewater | CT      | 97562        | USA       |             | King              | Julie              | Small      |
| 10182                                                                                                                                                                                                                                  | 47.0              | 74.22       | 16.0              | 3488.34 | 11/12/2003 0:00 | Shipped  | 4.0      | 11.0       | 2003.0    | Classic Cars  | 73.0   | S24_1046      | Mini Gifts Distributors Ltd. | 4155551450 | 5677 Strong St.     |                | San Rafael  | CA      | 97562        | USA       |             | Nelson            | Valarie            | Medium     |


Target Schema:
| PRODUCTLINE      |            SALES |
|:-----------------|-----------------:|
| Classic Cars     |      1.48938e+06 |
| Motorcycles      | 364712           |
| Planes           | 116886           |
| Ships            |  39491.1         |
| Trains           |  48023.7         |
| Trucks and Buses | 335705           |
| Vintage Cars     | 767977           |

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