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:
|   emp_length |
|-------------:|
|          706 |
|          317 |
|          304 |
|          292 |
|          271 |
|          264 |
|          216 |
|          193 |
|          134 |
|          114 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          246 |
|          218 |
|          214 |
|          170 |
|          116 |
|           99 |


Table #3
Filename: source_10.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          531 |
|          501 |
|          439 |
|          414 |
|          286 |
|          228 |
|          174 |
|          136 |
|          110 |
|          106 |


Table #4
Filename: source_11.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          657 |
|          387 |
|          348 |
|          299 |
|          287 |
|          267 |
|          185 |
|          140 |
|          132 |
|          117 |


Table #5
Filename: source_12.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          548 |
|          487 |
|          394 |
|          354 |
|          297 |
|          253 |
|          198 |
|          126 |
|          123 |
|          115 |


Table #6
Filename: source_13.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          644 |
|          460 |
|          347 |
|          301 |
|          262 |
|          255 |
|          174 |
|          150 |
|          116 |
|          113 |


Table #7
Filename: source_14.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          542 |
|          507 |
|          378 |
|          349 |
|          288 |
|          226 |
|          186 |
|          161 |
|          128 |
|          112 |


Table #8
Filename: source_2.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          582 |
|          409 |
|          368 |
|          303 |
|          274 |
|          263 |
|          233 |
|          132 |
|          123 |
|          122 |


Table #9
Filename: source_3.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          766 |
|          309 |
|          286 |
|          284 |
|          260 |
|          251 |
|          219 |
|          178 |
|          157 |
|          109 |


Table #10
Filename: source_4.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          764 |
|          284 |
|          282 |
|          277 |
|          272 |
|          257 |
|          216 |
|          176 |
|          137 |
|          122 |


Table #11
Filename: source_5.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          813 |
|          283 |
|          266 |
|          264 |
|          262 |
|          245 |
|          219 |
|          197 |
|          141 |
|          114 |


Table #12
Filename: source_6.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          744 |
|          295 |
|          292 |
|          268 |
|          242 |
|          241 |
|          219 |
|          215 |
|          146 |
|          114 |


Table #13
Filename: source_7.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          149 |
|          105 |
|           68 |
|           61 |
|           42 |
|           34 |
|           24 |
|           18 |
|           13 |
|           12 |


Table #14
Filename: source_8.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          695 |
|          356 |
|          346 |
|          323 |
|          262 |
|          251 |
|          222 |
|          153 |
|          126 |
|          101 |


Table #15
Filename: source_9.csv
Sample Rows in Markdown:
|   emp_length |
|-------------:|
|          661 |
|          327 |
|          302 |
|          291 |
|          290 |
|          251 |
|          235 |
|          178 |
|          148 |
|          106 |


Target Schema:
|   emp_length |
|-------------:|
|          746 |
|          304 |
|          277 |
|          267 |
|          260 |
|          744 |
|          295 |
|          292 |
|          268 |
|          242 |

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_10.csv
source_11.csv
source_12.csv
source_13.csv
source_14.csv
source_2.csv
source_3.csv
source_4.csv
source_5.csv
source_6.csv
source_7.csv
source_8.csv
source_9.csv
test: test_0.csv
test_1.csv
test_10.csv
test_11.csv
test_12.csv
test_13.csv
test_14.csv
test_2.csv
test_3.csv
test_4.csv
test_5.csv
test_6.csv
test_7.csv
test_8.csv
test_9.csv