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:
| State Name     | county Name   |   State Code |   County Code | Date       |   AQI | Category                       | Defining Parameter   | Defining Site   |   Number of Sites Reporting |   Year |   Month |
|:---------------|:--------------|-------------:|--------------:|:-----------|------:|:-------------------------------|:---------------------|:----------------|----------------------------:|-------:|--------:|
| Minnesota      | Washington    |           27 |           163 | 2019-07-14 |    41 | Good                           | Ozone                | 27-163-6016     |                           2 |   2019 |       7 |
| North Carolina | Cumberland    |           37 |            51 | 2019-06-13 |    41 | Good                           | Ozone                | 37-051-0010     |                           3 |   2019 |       6 |
| Maryland       | Allegany      |           24 |             1 | 2019-06-02 |     1 | Good                           | SO2                  | 24-001-8882     |                           2 |   2019 |       6 |
| California     | Tulare        |            6 |           107 | 2019-09-01 |   136 | Unhealthy for Sensitive Groups | Ozone                | 06-107-0009     |                           4 |   2019 |       9 |
| Indiana        | Allen         |           18 |             3 | 2019-02-20 |    53 | Moderate                       | PM2.5                | 18-003-0004     |                           2 |   2019 |       2 |
| Connecticut    | Middlesex     |            9 |             7 | 2019-06-16 |    39 | Good                           | Ozone                | 09-007-9007     |                           1 |   2019 |       6 |
| Texas          | Nueces        |           48 |           355 | 2019-07-16 |    38 | Good                           | PM2.5                | 48-355-0032     |                           4 |   2019 |       7 |
| Michigan       | Clinton       |           26 |            37 | 2019-04-25 |    40 | Good                           | Ozone                | 26-037-0002     |                           1 |   2019 |       4 |
| New York       | Niagara       |           36 |            63 | 2019-04-06 |    45 | Good                           | Ozone                | 36-063-1006     |                           1 |   2019 |       4 |
| California     | Plumas        |            6 |            63 | 2019-01-29 |    66 | Moderate                       | PM2.5                | 06-063-1006     |                           1 |   2019 |       1 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| State Name   | county Name   |   State Code |   County Code | Date       |   AQI | Category   | Defining Parameter   | Defining Site   |   Number of Sites Reporting |   Year |   Month |
|:-------------|:--------------|-------------:|--------------:|:-----------|------:|:-----------|:---------------------|:----------------|----------------------------:|-------:|--------:|
| Wyoming      | Albany        |           56 |             1 | 2017-02-15 |    50 | Good       | Ozone                | 56-001-9991     |                           6 |   2017 |       2 |
| New Jersey   | Bergen        |           34 |             3 | 2017-05-25 |    40 | Good       | Ozone                | 34-003-0006     |                           3 |   2017 |       5 |
| Oklahoma     | Love          |           40 |            85 | 2017-09-30 |    51 | Moderate   | Ozone                | 40-085-0300     |                           1 |   2017 |       9 |
| Louisiana    | Ouachita      |           22 |            73 | 2017-09-12 |    26 | Good       | Ozone                | 22-073-0004     |                           1 |   2017 |       9 |
| New York     | Westchester   |           36 |           119 | 2017-01-15 |    45 | Good       | PM2.5                | 36-119-2004     |                           1 |   2017 |       1 |
| Kentucky     | Warren        |           21 |           227 | 2017-07-08 |    41 | Good       | Ozone                | 21-227-0009     |                           1 |   2017 |       7 |
| Florida      | Collier       |           12 |            21 | 2017-10-22 |    21 | Good       | Ozone                | 12-021-0004     |                           1 |   2017 |      10 |
| Missouri     | Cedar         |           29 |            39 | 2017-01-17 |    12 | Good       | PM2.5                | 29-039-0001     |                           1 |   2017 |       1 |
| California   | Marin         |            6 |            41 | 2017-11-18 |    25 | Good       | PM2.5                | 06-041-0001     |                           2 |   2017 |      11 |
| Virginia     | Fairfax       |           51 |            59 | 2017-07-20 |    97 | Moderate   | Ozone                | 51-059-0030     |                           2 |   2017 |       7 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| State Name   | county Name   |   State Code |   County Code | Date       |   AQI | Category   | Defining Parameter   | Defining Site   |   Number of Sites Reporting |   Year |   Month |
|:-------------|:--------------|-------------:|--------------:|:-----------|------:|:-----------|:---------------------|:----------------|----------------------------:|-------:|--------:|
| Utah         | Davis         |           49 |            11 | 2016-09-20 |    44 | Good       | Ozone                | 49-011-0004     |                           1 |   2016 |       9 |
| Texas        | Tarrant       |           48 |           439 | 2016-08-25 |    39 | Good       | Ozone                | 48-439-3009     |                           7 |   2016 |       8 |
| Missouri     | Clay          |           29 |            47 | 2016-05-31 |    49 | Good       | Ozone                | 29-047-0006     |                           3 |   2016 |       5 |
| Florida      | Pinellas      |           12 |           103 | 2016-01-15 |    38 | Good       | Ozone                | 12-103-5002     |                           6 |   2016 |       1 |
| Idaho        | Canyon        |           16 |            27 | 2016-04-26 |    23 | Good       | PM2.5                | 16-027-0002     |                           1 |   2016 |       4 |
| Texas        | Johnson       |           48 |           251 | 2016-06-26 |    24 | Good       | Ozone                | 48-251-0003     |                           1 |   2016 |       6 |
| Pennsylvania | Elk           |           42 |            47 | 2016-12-13 |    26 | Good       | Ozone                | 42-047-9991     |                           1 |   2016 |      12 |
| Colorado     | Pitkin        |            8 |            97 | 2016-10-12 |    16 | Good       | PM10                 | 08-097-0008     |                           2 |   2016 |      10 |
| Wyoming      | Natrona       |           56 |            25 | 2016-10-17 |    39 | Good       | Ozone                | 56-025-0100     |                           2 |   2016 |      10 |
| Missouri     | Clay          |           29 |            47 | 2016-02-17 |    45 | Good       | PM2.5                | 29-047-0005     |                           1 |   2016 |       2 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| State Name   | county Name   |   State Code |   County Code | Date       |   AQI | Category   | Defining Parameter   | Defining Site   |   Number of Sites Reporting |   Year |   Month |
|:-------------|:--------------|-------------:|--------------:|:-----------|------:|:-----------|:---------------------|:----------------|----------------------------:|-------:|--------:|
| Indiana      | Dubois        |           18 |            37 | 2020-01-04 |    33 | Good       | PM2.5                | 18-037-2001     |                           1 |   2020 |       1 |
| Florida      | Sarasota      |           12 |           115 | 2020-03-02 |    44 | Good       | Ozone                | 12-115-2002     |                           4 |   2020 |       3 |
| Oklahoma     | Johnston      |           40 |            69 | 2020-02-14 |    32 | Good       | Ozone                | 40-069-0324     |                           1 |   2020 |       2 |
| Maryland     | Howard        |           24 |            27 | 2020-03-17 |    28 | Good       | PM2.5                | 24-027-0006     |                           1 |   2020 |       3 |
| Iowa         | Montgomery    |           19 |           137 | 2020-03-11 |    35 | Good       | PM2.5                | 19-137-0002     |                           1 |   2020 |       3 |
| Ohio         | Columbiana    |           39 |            29 | 2020-01-05 |     1 | Good       | SO2                  | 39-029-0019     |                           1 |   2020 |       1 |
| Florida      | Polk          |           12 |           105 | 2020-02-22 |    43 | Good       | Ozone                | 12-105-6005     |                           2 |   2020 |       2 |
| California   | Shasta        |            6 |            89 | 2020-01-29 |    39 | Good       | Ozone                | 06-089-3003     |                           1 |   2020 |       1 |
| New York     | Oneida        |           36 |            65 | 2020-03-21 |    14 | Good       | PM2.5                | 36-065-2001     |                           1 |   2020 |       3 |
| Indiana      | Greene        |           18 |            55 | 2020-01-21 |    29 | Good       | Ozone                | 18-055-0001     |                           1 |   2020 |       1 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| State Name     | county Name    |   State Code |   County Code | Date       |   AQI | Category   | Defining Parameter   | Defining Site   |   Number of Sites Reporting |   Year |   Month |
|:---------------|:---------------|-------------:|--------------:|:-----------|------:|:-----------|:---------------------|:----------------|----------------------------:|-------:|--------:|
| Ohio           | Cuyahoga       |           39 |            35 | 2018-12-14 |    71 | Moderate   | PM2.5                | 39-035-0060     |                           5 |   2018 |      12 |
| Virginia       | Hampton City   |           51 |           650 | 2018-07-01 |    45 | Good       | PM2.5                | 51-650-0008     |                           1 |   2018 |       7 |
| Tennessee      | Maury          |           47 |           119 | 2018-09-04 |    19 | Good       | PM2.5                | 47-119-2007     |                           1 |   2018 |       9 |
| Ohio           | Clark          |           39 |            23 | 2018-03-12 |    50 | Good       | PM2.5                | 39-023-0005     |                           3 |   2018 |       3 |
| Tennessee      | Sumner         |           47 |           165 | 2018-10-06 |    39 | Good       | Ozone                | 47-165-0007     |                           1 |   2018 |      10 |
| North Carolina | New Hanover    |           37 |           129 | 2018-05-18 |    27 | Good       | Ozone                | 37-129-0002     |                           1 |   2018 |       5 |
| Texas          | Navarro        |           48 |           349 | 2018-01-15 |    64 | Moderate   | SO2                  | 48-349-1081     |                           2 |   2018 |       1 |
| Virginia       | Covington City |           51 |           580 | 2018-06-15 |    33 | Good       | SO2                  | 51-580-0008     |                           1 |   2018 |       6 |
| North Carolina | Cumberland     |           37 |            51 | 2018-11-03 |     6 | Good       | PM10                 | 37-051-0009     |                           2 |   2018 |      11 |
| Oklahoma       | Muskogee       |           40 |           101 | 2018-09-26 |     7 | Good       | PM10                 | 40-101-0167     |                           2 |   2018 |       9 |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| State Name     | county Name   |   State Code |   County Code | Date       |   AQI | Category   | Defining Parameter   | Defining Site   |   Number of Sites Reporting |   Year |   Month |
|:---------------|:--------------|-------------:|--------------:|:-----------|------:|:-----------|:---------------------|:----------------|----------------------------:|-------:|--------:|
| Michigan       | Monroe        |           26 |           115 | 2015-01-05 |     1 | Good       | SO2                  | 26-115-0006     |                           1 |   2015 |       1 |
| Wisconsin      | Dodge         |           55 |            27 | 2015-01-29 |    36 | Good       | PM2.5                | 55-027-0001     |                           1 |   2015 |       1 |
| Pennsylvania   | Westmoreland  |           42 |           129 | 2015-02-14 |    32 | Good       | PM2.5                | 42-129-0008     |                           1 |   2015 |       2 |
| Missouri       | Jackson       |           29 |            95 | 2015-11-11 |    69 | Moderate   | PM10                 | 29-095-0018     |                           3 |   2015 |      11 |
| Indiana        | Lake          |           18 |            89 | 2015-09-28 |    38 | Good       | PM2.5                | 18-089-0022     |                           4 |   2015 |       9 |
| New Mexico     | Santa Fe      |           35 |            49 | 2015-06-23 |    39 | Good       | Ozone                | 35-049-0021     |                           1 |   2015 |       6 |
| Montana        | Gallatin      |           30 |            31 | 2015-11-27 |    46 | Good       | PM2.5                | 30-031-0019     |                           2 |   2015 |      11 |
| Florida        | Lee           |           12 |            71 | 2015-06-25 |    42 | Good       | PM2.5                | 12-071-0005     |                           3 |   2015 |       6 |
| Washington     | Mason         |           53 |            45 | 2015-10-23 |    39 | Good       | PM2.5                | 53-045-0007     |                           1 |   2015 |      10 |
| North Carolina | Union         |           37 |           179 | 2015-09-15 |    50 | Good       | Ozone                | 37-179-0003     |                           1 |   2015 |       9 |


Target Schema:
| State Name   |   Year |   Month | county Name   |   State Code |   County Code | Date       |   AQI | Category                       | Defining Parameter   | Defining Site   |   Number of Sites Reporting |
|:-------------|-------:|--------:|:--------------|-------------:|--------------:|:-----------|------:|:-------------------------------|:---------------------|:----------------|----------------------------:|
| Alabama      |   2015 |       1 | Tuscaloosa    |            1 |           125 | 2015-01-31 |   141 | Unhealthy for Sensitive Groups | SO2                  | 01-125-0004     |                          10 |
| Alabama      |   2015 |       2 | Tuscaloosa    |            1 |           125 | 2015-02-28 |   170 | Unhealthy for Sensitive Groups | PM2.5                | 01-125-0004     |                          10 |
| Alabama      |   2015 |       3 | Tuscaloosa    |            1 |           125 | 2015-03-31 |   101 | Unhealthy for Sensitive Groups | SO2                  | 01-125-0010     |                          10 |
| Alabama      |   2015 |       4 | Tuscaloosa    |            1 |           125 | 2015-04-30 |    80 | Moderate                       | PM2.5                | 01-125-0010     |                          10 |
| Alabama      |   2015 |       5 | Tuscaloosa    |            1 |           125 | 2015-05-31 |   122 | Unhealthy for Sensitive Groups | PM2.5                | 01-125-0010     |                          10 |
| Alabama      |   2015 |       6 | Tuscaloosa    |            1 |           125 | 2015-06-30 |   112 | Unhealthy for Sensitive Groups | PM2.5                | 01-125-0010     |                          10 |
| Alabama      |   2015 |       7 | Tuscaloosa    |            1 |           125 | 2015-07-31 |    90 | Moderate                       | SO2                  | 01-125-0010     |                          10 |
| Alabama      |   2015 |       8 | Tuscaloosa    |            1 |           125 | 2015-08-31 |   147 | Unhealthy for Sensitive Groups | SO2                  | 01-125-0010     |                          10 |
| Alabama      |   2015 |       9 | Tuscaloosa    |            1 |           125 | 2015-09-30 |    97 | Moderate                       | PM2.5                | 01-125-0010     |                          10 |
| Alabama      |   2015 |      10 | Tuscaloosa    |            1 |           125 | 2015-10-31 |   129 | Unhealthy for Sensitive Groups | PM2.5                | 01-125-0010     |                          10 |

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
source_2.csv
source_3.csv
source_4.csv
source_5.csv
test: test_0.csv
test_1.csv
test_2.csv
test_3.csv
test_4.csv
test_5.csv