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:
| Institution                        |   year 2016 |
|:-----------------------------------|------------:|
| Angelo State University            |         949 |
| Lamar University                   |         931 |
| Midwestern State University        |         477 |
| Prairie View A&M University        |        1296 |
| Sam Houston State University       |        2036 |
| Stephen F. Austin State University |        1671 |
| Sul Ross State University          |         202 |
| Tarleton State University          |        1372 |
| Texas A&M International University |         831 |
| Texas A&M University               |        7790 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| Institution                        |   year 2014 |
|:-----------------------------------|------------:|
| Angelo State University            |         798 |
| Lamar University                   |         828 |
| Midwestern State University        |         573 |
| Prairie View A&M University        |        1060 |
| Sam Houston State University       |        1940 |
| Stephen F. Austin State University |        1540 |
| Sul Ross State University          |         194 |
| Tarleton State University          |        1326 |
| Texas A&M International University |         739 |
| Texas A&M University               |        8050 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| Institution                         | (Fall 2000)   | (Fall 2001)   | (Fall 2002)   | (Fall 2003)   | (Fall 2004)   | (Fall 2005)   | (Fall 2006)   | (Fall 2007)   | (Fall 2008)   |   (Fall 2009) |   (Fall 2010) |   (Fall 2011) |   (Fall 2012) |   (Fall 2013) |   (Fall 2014) |
|:------------------------------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|:--------------|--------------:|--------------:|--------------:|--------------:|--------------:|--------------:|
| Texas A&M University-Commerce       | 0.657         | 0.649         | 0.667         | 0.652         | 0.643         | 0.612         | 0.592         | 0.659         | 0.682         |         0.642 |         0.717 |         0.676 |         0.675 |         0.672 |         0.718 |
| Texas A&M University-Corpus Christi | 0.712         | 0.628         | 0.652         | 0.63          | 0.609         | 0.572         | 0.607         | 0.624         | 0.613         |         0.646 |         0.6   |         0.636 |         0.574 |         0.586 |         0.608 |
| Texas A&M University-Kingsville     | 0.609         | 0.586         | 0.548         | 0.511         | 0.608         | 0.626         | 0.603         | 0.596         | 0.586         |         0.581 |         0.557 |         0.615 |         0.635 |         0.635 |         0.688 |
| Texas A&M University-San Antonio    |               |               |               |               |               |               |               |               |               |         0     |         0     |         0     |         0     |         0     |         0     |
| Texas A&M University-Texarkana      | 0.0           | 0.0           | 0.0           | 0.0           | 0.0           | 0.0           | 0.0           | 0.0           | 0.0           |         0     |         0.465 |         0.424 |         0.428 |         0.57  |         0.485 |
| West Texas A&M University           | 0.655         | 0.655         | 0.653         | 0.656         | 0.657         | 0.628         | 0.66          | 0.64          | 0.637         |         0.614 |         0.641 |         0.613 |         0.651 |         0.66  |         0.631 |
| Angelo State University             | 0.574         | 0.615         | 0.593         | 0.63          | 0.612         | 0.603         | 0.591         | 0.556         | 0.582         |         0.633 |         0.623 |         0.599 |         0.542 |         0.62  |         0.621 |
| Texas Tech University               | 0.802         | 0.823         | 0.814         | 0.821         | 0.836         | 0.829         | 0.826         | 0.801         | 0.809         |         0.808 |         0.814 |         0.786 |         0.819 |         0.832 |         0.806 |
| University of North Texas           | 0.677         | 0.722         | 0.742         | 0.736         | 0.739         | 0.755         | 0.734         | 0.734         | 0.743         |         0.772 |         0.779 |         0.733 |         0.746 |         0.765 |         0.776 |
| University of North Texas at Dallas |               |               |               |               |               |               |               |               |               |         0     |         0.558 |         0.5   |         0.526 |         0.517 |         0.67  |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| Institution                        |   year 2015 |
|:-----------------------------------|------------:|
| Angelo State University            |         889 |
| Lamar University                   |         963 |
| Midwestern State University        |         571 |
| Prairie View A&M University        |        1118 |
| Sam Houston State University       |        1917 |
| Stephen F. Austin State University |        1603 |
| Sul Ross State University          |         188 |
| Tarleton State University          |        1295 |
| Texas A&M International University |         735 |
| Texas A&M University               |        7735 |


Table #5
Filename: source_4.csv
Sample Rows in Markdown:
| Institution                        |   Cohort 2014 |   Cohort 2015 |   Cohort 2016 |
|:-----------------------------------|--------------:|--------------:|--------------:|
| Angelo State University            |          1285 |          1336 |          1452 |
| Lamar University                   |          1411 |          1505 |          1457 |
| Midwestern State University        |           834 |           818 |           728 |
| Prairie View A&M University        |          1602 |          1614 |          1834 |
| Sam Houston State University       |          2449 |          2514 |          2667 |
| Stephen F. Austin State University |          2164 |          2243 |          2328 |
| Sul Ross State University          |           328 |           313 |           349 |
| Tarleton State University          |          2013 |          1831 |          2043 |
| Texas A&M International University |           970 |           963 |          1096 |
| Texas A&M University               |          8989 |          8493 |          8513 |


Target Schema:
| Institution                                  |   (Fall 2011) |   (Fall 2012) |   (Fall 2013) |   (Fall 2014) |   persist 2014 |   persist 2015 |   persist 2016 |   Cohort 2014 |   Cohort 2015 |   Cohort 2016 |
|:---------------------------------------------|--------------:|--------------:|--------------:|--------------:|---------------:|---------------:|---------------:|--------------:|--------------:|--------------:|
| The University of Texas at Arlington         |         0.713 |         0.702 |         0.68  |         0.702 |           1884 |           1874 |           2044 |          2684 |          2712 |          2898 |
| The University of Texas at Austin            |         0.926 |         0.935 |         0.93  |         0.935 |           6577 |           7038 |           8081 |          7031 |          7562 |          8566 |
| The University of Texas at Dallas            |         0.848 |         0.88  |         0.864 |         0.826 |           2049 |           2300 |           2716 |          2480 |          2656 |          3137 |
| The University of Texas at El Paso           |         0.717 |         0.699 |         0.676 |         0.718 |           2088 |           2190 |           2221 |          2908 |          2950 |          3004 |
| The University of Texas at San Antonio       |         0.622 |         0.643 |         0.634 |         0.676 |           3344 |           3461 |           3168 |          4948 |          4898 |          4306 |
| The University of Texas at Tyler             |         0.627 |         0.664 |         0.606 |         0.618 |            419 |            437 |            507 |           678 |           767 |           815 |
| The University of Texas of the Permian Basin |         0.648 |         0.663 |         0.691 |         0.678 |            278 |            327 |            295 |           410 |           478 |           452 |
| University of Houston                        |         0.831 |         0.846 |         0.85  |         0.863 |           3373 |           3393 |           3595 |          3909 |          4010 |          4263 |
| University of Houston-Clear Lake             |         0.833 |         0.5   |         0     |         0.698 |            141 |            173 |            166 |           202 |           228 |           227 |
| University of Houston-Downtown               |         0.667 |         0.625 |         0.657 |         0.658 |            601 |            521 |            593 |           914 |           790 |           829 |

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