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:
| air_store_id         |   dow |
|:---------------------|------:|
| air_00a91d42b08b08d9 |     3 |
| air_0164b9927d20bcc3 |     3 |
| air_0241aa3964b7f861 |     3 |
| air_0328696196e46f18 |     3 |
| air_034a3d5b40d5b1b1 |     3 |
| air_036d4f1ee7285390 |     3 |
| air_0382c794b73b51ad |     3 |
| air_03963426c9312048 |     3 |
| air_04341b588bde96cd |     3 |
| air_049f6d5b402a31b2 |     3 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| air_store_id         |   dow |
|:---------------------|------:|
| air_00a91d42b08b08d9 |     5 |
| air_0164b9927d20bcc3 |     5 |
| air_0241aa3964b7f861 |     5 |
| air_0328696196e46f18 |     5 |
| air_034a3d5b40d5b1b1 |     5 |
| air_036d4f1ee7285390 |     5 |
| air_0382c794b73b51ad |     5 |
| air_03963426c9312048 |     5 |
| air_04341b588bde96cd |     5 |
| air_049f6d5b402a31b2 |     5 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| air_store_id         |   dow |
|:---------------------|------:|
| air_00a91d42b08b08d9 |     4 |
| air_0164b9927d20bcc3 |     4 |
| air_0241aa3964b7f861 |     4 |
| air_0328696196e46f18 |     4 |
| air_034a3d5b40d5b1b1 |     4 |
| air_036d4f1ee7285390 |     4 |
| air_0382c794b73b51ad |     4 |
| air_03963426c9312048 |     4 |
| air_04341b588bde96cd |     4 |
| air_049f6d5b402a31b2 |     4 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| air_store_id         |   dow |
|:---------------------|------:|
| air_00a91d42b08b08d9 |     2 |
| air_0164b9927d20bcc3 |     2 |
| air_0241aa3964b7f861 |     2 |
| air_0328696196e46f18 |     2 |
| air_034a3d5b40d5b1b1 |     2 |
| air_036d4f1ee7285390 |     2 |
| air_0382c794b73b51ad |     2 |
| air_03963426c9312048 |     2 |
| air_04341b588bde96cd |     2 |
| air_049f6d5b402a31b2 |     2 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| air_store_id         |   dow |
|:---------------------|------:|
| air_00a91d42b08b08d9 |     6 |
| air_0164b9927d20bcc3 |     6 |
| air_0241aa3964b7f861 |     6 |
| air_0328696196e46f18 |     6 |
| air_034a3d5b40d5b1b1 |     6 |
| air_036d4f1ee7285390 |     6 |
| air_0382c794b73b51ad |     6 |
| air_03963426c9312048 |     6 |
| air_04341b588bde96cd |     6 |
| air_049f6d5b402a31b2 |     6 |


Table #6
Filename: source_5.csv
Sample Rows in Markdown:
| air_store_id         |   dow |
|:---------------------|------:|
| air_84060403939d8216 |     0 |
| air_848616680ef061bd |     0 |
| air_84f6876ff7e83ae7 |     0 |
| air_8523d6a70de49e6c |     0 |
| air_859feab8e3c9f98d |     0 |
| air_85bd13a49370c392 |     0 |
| air_86cfbf2624576fad |     0 |
| air_86f7b2109e4abd65 |     0 |
| air_87059630ab6fe47f |     0 |
| air_87078cf7903a648c |     0 |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
| air_store_id         |   dow |
|:---------------------|------:|
| air_00a91d42b08b08d9 |     1 |
| air_0164b9927d20bcc3 |     1 |
| air_0241aa3964b7f861 |     1 |
| air_0328696196e46f18 |     1 |
| air_034a3d5b40d5b1b1 |     1 |
| air_036d4f1ee7285390 |     1 |
| air_0382c794b73b51ad |     1 |
| air_03963426c9312048 |     1 |
| air_04341b588bde96cd |     1 |
| air_049f6d5b402a31b2 |     1 |


Target Schema:
| air_store_id         |   dow |
|:---------------------|------:|
| air_00a91d42b08b08d9 |     0 |
| air_0164b9927d20bcc3 |     0 |
| air_0241aa3964b7f861 |     0 |
| air_0328696196e46f18 |     0 |
| air_034a3d5b40d5b1b1 |     0 |
| air_036d4f1ee7285390 |     0 |
| air_0382c794b73b51ad |     0 |
| air_03963426c9312048 |     0 |
| air_04341b588bde96cd |     0 |
| air_049f6d5b402a31b2 |     0 |

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
source_6.csv
test: test_0.csv
test_1.csv
test_2.csv
test_3.csv
test_4.csv
test_5.csv
test_6.csv