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:
| anon_screen_name                         | Class   | EngStatus     |
|:-----------------------------------------|:--------|:--------------|
| 1e7ef19f7d2b16cf71044c8064268b5bfd798d16 | Engaged | Time >=1 hour |
| d5fd321e713188cffd5cb88dd741644877536e37 | Engaged | Time >=1 hour |
| ae8ff88b09212191ade4b9573d4eaba7d01c03a5 | Engaged | Time >=1 hour |
| 8b7b150270f1989f51973ab13a5fab65ea9c4ad8 | Engaged | Time >=1 hour |
| 27950f57718267a62f888eb3bd94b2b5e402e931 | Engaged | Time >=1 hour |
| fc65ebff6919dcccc9e1845a0bea338ee09a8339 | Engaged | Time >=1 hour |
| e7eba994233bdc4650c0e2282903866c2d940c81 | Engaged | Time >=1 hour |
| d8d8b43c283088db7744598cd10578f425f1f36e | Engaged | Time >=1 hour |
| 68592ab6dcadb7a15499b0426bb75b72fcecc84f | Engaged | Time >=1 hour |
| 092f57555dff5b3fece68be0c3f5d0da82da0586 | Engaged | Time >=1 hour |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| anon_screen_name                         |   QuzAttmptAvg1 |   QuzCount1 |   QuzAvSco1 |   QuzLagMean1 |   LecLag1 |   LecCount1 |   VidActCount1 |   eff1 |   Finalgrade | FinalScore   | Class           | EngStatus     |
|:-----------------------------------------|----------------:|------------:|------------:|--------------:|----------:|------------:|---------------:|-------:|-------------:|:-------------|:----------------|:--------------|
| b60b8b1b3f4167c97527f029c80e4b75fc515674 |               0 |           0 |           0 |             0 |         0 |           0 |             20 |   1216 |         0.96 | Pass         | AboveAvgEngaged | Time >=1 hour |
| b60ff9a22894ce86854bd5ef0cbc984915501b55 |               0 |           0 |           0 |             0 |         0 |           0 |              3 |      0 |         0.03 | Fail         | AverageEngaged  | Time<20Mins   |
| b61120dd6ae8bb94e1645650a97f796ea26f6902 |               0 |           0 |           0 |             0 |         0 |           0 |              4 |   5605 |         0    | Fail         | AverageEngaged  | Time<20Mins   |
| b6147f83640a1a8b19995166f0174146aa983b94 |               0 |           0 |           0 |             0 |         0 |           0 |             11 |    632 |         0.01 | Fail         | BelowAverage    | Time<10Mins   |
| b619b88e54396323ff1c678ff938bafa22a604a8 |               0 |           0 |           0 |             0 |         0 |           0 |              3 |      0 |         0.08 | Fail         | AverageEngaged  | Time<20Mins   |
| b62970de9accaa45675a83450500ee90cb6c8256 |               0 |           0 |           0 |             0 |         0 |           0 |              6 |      0 |         0.39 | Fail         | BelowAverage    | Time<10Mins   |
| b636f10f4c5586ba922a82c2350d0f51b8c6b8a6 |               0 |           0 |           0 |             0 |         0 |           0 |              4 |      0 |         0.12 | Fail         | AverageEngaged  | Time<1hour    |
| b639af7c6182f68499cbf2167061a0026bca4e5b |               0 |           0 |           0 |             0 |         0 |           0 |              1 |     80 |         0    | Fail         | BelowAverage    | Time<10Mins   |
| b63d6ebad023ee35c43659b4eae20dd16530cfcd |               0 |           0 |           0 |             0 |         0 |           0 |              3 |      0 |         0    | Fail         | BelowAverage    | Time<10Mins   |
| b642841b41d54bc347d178d5de05daa828375e97 |               0 |           0 |           0 |             0 |         0 |           0 |             17 |      0 |         0.08 | Fail         | AverageEngaged  | Time<30Mins   |


Target Schema:
| anon_screen_name                         | Class_x   | EngStatus_x   |   QuzAttmptAvg1_x |   QuzCount1_x |   QuzAvSco1_x |   QuzLagMean1_x |   LecLag1_x |   LecCount1_x |   VidActCount1_x |   eff1_x |   Finalgrade_x | FinalScore_x   | Class_y         | EngStatus_y   |   QuzAttmptAvg1_y |   QuzCount1_y |   QuzAvSco1_y |   QuzLagMean1_y |   LecLag1_y |   LecCount1_y |   VidActCount1_y |   eff1_y |   Finalgrade_y | FinalScore_y   | Class_x_25      | EngStatus_x_26   |   QuzAttmptAvg1_x_27 |   QuzCount1_x_28 |   QuzAvSco1_x_29 |   QuzLagMean1_x_30 |   LecLag1_x_31 |   LecCount1_x_32 |   VidActCount1_x_33 |   eff1_x_34 |   Finalgrade_x_35 | FinalScore_x_36   | Class_y_37      | EngStatus_y_38   |   QuzAttmptAvg1_y_39 |   QuzCount1_y_40 |   QuzAvSco1_y_41 |   QuzLagMean1_y_42 |   LecLag1_y_43 |   LecCount1_y_44 |   VidActCount1_y_45 |   eff1_y_46 |   Finalgrade_y_47 | FinalScore_y_48   | Class_x_49      | EngStatus_x_50   |   QuzAttmptAvg1_x_51 |   QuzCount1_x_52 |   QuzAvSco1_x_53 |   QuzLagMean1_x_54 |   LecLag1_x_55 |   LecCount1_x_56 |   VidActCount1_x_57 |   eff1_x_58 |   Finalgrade_x_59 | FinalScore_x_60   | Class_y_61      | EngStatus_y_62   |   QuzAttmptAvg1_y_63 |   QuzCount1_y_64 |   QuzAvSco1_y_65 |   QuzLagMean1_y_66 |   LecLag1_y_67 |   LecCount1_y_68 |   VidActCount1_y_69 |   eff1_y_70 |   Finalgrade_y_71 | FinalScore_y_72   | Class_x_73      | EngStatus_x_74   |   QuzAttmptAvg1 |   QuzCount1 |   QuzAvSco1 |   QuzLagMean1 |   LecLag1 |   LecCount1 |   VidActCount1 |   eff1 |   Finalgrade | FinalScore   | Class_y_85      | EngStatus_y_86   |
|:-----------------------------------------|:----------|:--------------|------------------:|--------------:|--------------:|----------------:|------------:|--------------:|-----------------:|---------:|---------------:|:---------------|:----------------|:--------------|------------------:|--------------:|--------------:|----------------:|------------:|--------------:|-----------------:|---------:|---------------:|:---------------|:----------------|:-----------------|---------------------:|-----------------:|-----------------:|-------------------:|---------------:|-----------------:|--------------------:|------------:|------------------:|:------------------|:----------------|:-----------------|---------------------:|-----------------:|-----------------:|-------------------:|---------------:|-----------------:|--------------------:|------------:|------------------:|:------------------|:----------------|:-----------------|---------------------:|-----------------:|-----------------:|-------------------:|---------------:|-----------------:|--------------------:|------------:|------------------:|:------------------|:----------------|:-----------------|---------------------:|-----------------:|-----------------:|-------------------:|---------------:|-----------------:|--------------------:|------------:|------------------:|:------------------|:----------------|:-----------------|----------------:|------------:|------------:|--------------:|----------:|------------:|---------------:|-------:|-------------:|:-------------|:----------------|:-----------------|
| 1e7ef19f7d2b16cf71044c8064268b5bfd798d16 | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               41 |    23228 |           0.85 | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               41 |    23228 |           0.85 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  41 |       23228 |              0.85 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  41 |       23228 |              0.85 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  41 |       23228 |              0.85 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  41 |       23228 |              0.85 | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |             41 |  23228 |         0.85 | Pass         | AboveAvgEngaged | Time >=1 hour    |
| ae8ff88b09212191ade4b9573d4eaba7d01c03a5 | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |              153 |    25996 |           0.8  | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |              153 |    25996 |           0.8  | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                 153 |       25996 |              0.8  | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                 153 |       25996 |              0.8  | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                 153 |       25996 |              0.8  | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                 153 |       25996 |              0.8  | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |            153 |  25996 |         0.8  | Pass         | AboveAvgEngaged | Time >=1 hour    |
| 8b7b150270f1989f51973ab13a5fab65ea9c4ad8 | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               56 |    36281 |           0.99 | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               56 |    36281 |           0.99 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  56 |       36281 |              0.99 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  56 |       36281 |              0.99 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  56 |       36281 |              0.99 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  56 |       36281 |              0.99 | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |             56 |  36281 |         0.99 | Pass         | AboveAvgEngaged | Time >=1 hour    |
| 27950f57718267a62f888eb3bd94b2b5e402e931 | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               38 |     8733 |           0.89 | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               38 |     8733 |           0.89 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  38 |        8733 |              0.89 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  38 |        8733 |              0.89 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  38 |        8733 |              0.89 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  38 |        8733 |              0.89 | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |             38 |   8733 |         0.89 | Pass         | AboveAvgEngaged | Time >=1 hour    |
| fc65ebff6919dcccc9e1845a0bea338ee09a8339 | Engaged   | Time >=1 hour |                 2 |            12 |            66 |        52686480 |    22114380 |            12 |               69 |    23997 |           0.59 | Pass           | AboveAvgEngaged | Time >=1 hour |                 2 |            12 |            66 |        52686480 |    22114380 |            12 |               69 |    23997 |           0.59 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    2 |               12 |               66 |           52686480 |       22114380 |               12 |                  69 |       23997 |              0.59 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    2 |               12 |               66 |           52686480 |       22114380 |               12 |                  69 |       23997 |              0.59 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    2 |               12 |               66 |           52686480 |       22114380 |               12 |                  69 |       23997 |              0.59 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    2 |               12 |               66 |           52686480 |       22114380 |               12 |                  69 |       23997 |              0.59 | Pass              | AboveAvgEngaged | Time >=1 hour    |               2 |          12 |          66 |      52686480 |  22114380 |          12 |             69 |  23997 |         0.59 | Pass         | AboveAvgEngaged | Time >=1 hour    |
| 68592ab6dcadb7a15499b0426bb75b72fcecc84f | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               18 |    35762 |           0.93 | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               18 |    35762 |           0.93 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  18 |       35762 |              0.93 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  18 |       35762 |              0.93 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  18 |       35762 |              0.93 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  18 |       35762 |              0.93 | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |             18 |  35762 |         0.93 | Pass         | AboveAvgEngaged | Time >=1 hour    |
| 092f57555dff5b3fece68be0c3f5d0da82da0586 | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               71 |    56367 |           0.95 | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               71 |    56367 |           0.95 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  71 |       56367 |              0.95 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  71 |       56367 |              0.95 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  71 |       56367 |              0.95 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  71 |       56367 |              0.95 | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |             71 |  56367 |         0.95 | Pass         | AboveAvgEngaged | Time >=1 hour    |
| 655679b26d4ac843f5aa43f69a0ae9aa1b68f77e | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |              116 |    40187 |           0.59 | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |              116 |    40187 |           0.59 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                 116 |       40187 |              0.59 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                 116 |       40187 |              0.59 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                 116 |       40187 |              0.59 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                 116 |       40187 |              0.59 | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |            116 |  40187 |         0.59 | Pass         | AboveAvgEngaged | Time >=1 hour    |
| 1de96d9868c355a62627011b95c52bfe5d80ae44 | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               48 |    13295 |           0.93 | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               48 |    13295 |           0.93 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  48 |       13295 |              0.93 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  48 |       13295 |              0.93 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  48 |       13295 |              0.93 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  48 |       13295 |              0.93 | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |             48 |  13295 |         0.93 | Pass         | AboveAvgEngaged | Time >=1 hour    |
| 166ec95bc0dab27f9d325b3c5f50507ce24381a9 | Engaged   | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               35 |    21054 |           0.89 | Pass           | AboveAvgEngaged | Time >=1 hour |                 0 |             0 |             0 |               0 |           0 |             0 |               35 |    21054 |           0.89 | Pass           | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  35 |       21054 |              0.89 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  35 |       21054 |              0.89 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  35 |       21054 |              0.89 | Pass              | AboveAvgEngaged | Time >=1 hour    |                    0 |                0 |                0 |                  0 |              0 |                0 |                  35 |       21054 |              0.89 | Pass              | AboveAvgEngaged | Time >=1 hour    |               0 |           0 |           0 |             0 |         0 |           0 |             35 |  21054 |         0.89 | Pass         | AboveAvgEngaged | Time >=1 hour    |

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