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:
|   Major_code | Major                                   | Major_category                      |   Total |   Employed |   Employed_full_time_year_round |   Unemployed |   Unemployment_rate |   Median |   P25th |   P75th |
|-------------:|:----------------------------------------|:------------------------------------|--------:|-----------:|--------------------------------:|-------------:|--------------------:|---------:|--------:|--------:|
|         3608 | PHYSIOLOGY                              | Biology & Life Science              |   43984 |      31394 |                           20207 |         1692 |           0.0511395 |    50000 |   30000 |   75000 |
|         3609 | ZOOLOGY                                 | Biology & Life Science              |   55395 |      35714 |                           26152 |         1815 |           0.0483626 |    55000 |   34000 |   85000 |
|         3611 | NEUROSCIENCE                            | Biology & Life Science              |   13676 |       8987 |                            5446 |          665 |           0.0688976 |    35000 |   28000 |   52000 |
|         3699 | MISCELLANEOUS BIOLOGY                   | Biology & Life Science              |   29389 |      22298 |                           16508 |         1114 |           0.0475824 |    52000 |   33500 |   72800 |
|         3700 | MATHEMATICS                             | Computers & Mathematics             |  432806 |     280902 |                          209838 |        15701 |           0.0529361 |    66000 |   42000 |  100000 |
|         3701 | APPLIED MATHEMATICS                     | Computers & Mathematics             |   19112 |      15136 |                           12109 |          892 |           0.0556526 |    70000 |   47000 |  106000 |
|         3702 | STATISTICS AND DECISION SCIENCE         | Computers & Mathematics             |   24806 |      18808 |                           14468 |         1138 |           0.057054  |    70000 |   43000 |  102000 |
|         3801 | MILITARY TECHNOLOGIES                   | Industrial Arts & Consumer Services |    4315 |       1650 |                            1708 |          187 |           0.101796  |    64000 |   39750 |   90000 |
|         4000 | MULTI/INTERDISCIPLINARY STUDIES         | Interdisciplinary                   |   45199 |      35706 |                           26038 |         2990 |           0.077269  |    43000 |   32000 |   55000 |
|         4001 | INTERCULTURAL AND INTERNATIONAL STUDIES | Humanities & Liberal Arts           |   56580 |      43114 |                           27499 |         3462 |           0.0743301 |    45000 |   30000 |   69000 |


Target Schema:
| Major_category                      |   Median |
|:------------------------------------|---------:|
| Agriculture & Natural Resources     |  55000   |
| Biology & Life Science              |  51833.3 |
| Communications & Journalism         |  49500   |
| Computers & Mathematics             |  61571.4 |
| Education                           |  43831.2 |
| Engineering                         |  77857.1 |
| Humanities & Liberal Arts           |  46712.5 |
| Industrial Arts & Consumer Services |  40250   |
| Law & Public Policy                 |  49000   |

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