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:
| name         | Gender   | Eye color   | Race   | Hair color   |   Height | Publisher     | Skin color   | Alignment   |   Weight |
|:-------------|:---------|:------------|:-------|:-------------|---------:|:--------------|:-------------|:------------|---------:|
| John Stewart | Male     | green       | Human  | Black        |      185 | DC Comics     | -            | good        |       90 |
| John Wraith  | Male     | brown       | -      | Black        |      183 | Marvel Comics | -            | good        |       88 |
| Joker        | Male     | green       | Human  | Green        |      196 | DC Comics     | white        | bad         |       86 |
| Jolt         | Female   | blue        | -      | Black        |      165 | Marvel Comics | -            | good        |       49 |
| Jubilee      | Female   | red         | Mutant | Black        |      165 | Marvel Comics | -            | good        |       52 |
| Judge Dredd  | Male     | -           | Human  | -            |      188 | Rebellion     | -            | good        |      -99 |
| Juggernaut   | Male     | blue        | Human  | Red          |      287 | Marvel Comics | -            | neutral     |      855 |
| Junkpile     | Male     | -           | Mutant | -            |      -99 | Marvel Comics | -            | bad         |      -99 |
| Justice      | Male     | hazel       | Human  | Brown        |      178 | Marvel Comics | -            | good        |       81 |
| Jyn Erso     | Female   | green       | Human  | Brown        |      -99 | George Lucas  | -            | good        |      -99 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| hero_names    | Agility   | Accelerated Healing   | Lantern Power Ring   | Dimensional Awareness   | Cold Resistance   | Durability   | Stealth   | Energy Absorption   | Flight   | Danger Sense   | Underwater breathing   | Marksmanship   | Weapons Master   | Power Augmentation   | Animal Attributes   | Longevity   | Intelligence   | Super Strength   | Cryokinesis   | Telepathy   | Energy Armor   | Energy Blasts   | Duplication   | Size Changing   | Density Control   | Stamina   | Astral Travel   | Audio Control   | Dexterity   | Omnitrix   | Super Speed   | Possession   | Animal Oriented Powers   | Weapon-based Powers   | Electrokinesis   | Darkforce Manipulation   | Death Touch   | Teleportation   | Enhanced Senses   | Telekinesis   | Energy Beams   | Magic   | Hyperkinesis   | Jump   | Clairvoyance   | Dimensional Travel   | Power Sense   | Shapeshifting   | Peak Human Condition   | Immortality   | Camouflage   | Element Control   | Phasing   | Astral Projection   | Electrical Transport   | Fire Control   | Projection   | Summoning   | Enhanced Memory   | Reflexes   | Invulnerability   | Energy Constructs   | Force Fields   | Self-Sustenance   | Anti-Gravity   | Empathy   | Power Nullifier   | Radiation Control   | Psionic Powers   | Elasticity   | Substance Secretion   | Elemental Transmogrification   | Technopath/Cyberpath   | Photographic Reflexes   | Seismic Power   | Animation   | Precognition   | Mind Control   | Fire Resistance   | Power Absorption   | Enhanced Hearing   | Nova Force   | Insanity   | Hypnokinesis   | Animal Control   | Natural Armor   | Intangibility   | Enhanced Sight   | Molecular Manipulation   | Heat Generation   | Adaptation   | Gliding   | Power Suit   | Mind Blast   | Probability Manipulation   | Gravity Control   | Regeneration   | Light Control   | Echolocation   | Levitation   | Toxin and Disease Control   | Banish   | Energy Manipulation   | Heat Resistance   | Natural Weapons   | Time Travel   | Enhanced Smell   | Illusions   | Thirstokinesis   | Hair Manipulation   | Illumination   | Omnipotent   | Cloaking   | Changing Armor   | Power Cosmic   | Biokinesis   | Water Control   | Radiation Immunity   | Vision - Telescopic   | Toxin and Disease Resistance   | Spatial Awareness   | Energy Resistance   | Telepathy Resistance   | Molecular Combustion   | Omnilingualism   | Portal Creation   | Magnetism   | Mind Control Resistance   | Plant Control   | Sonar   | Sonic Scream   | Time Manipulation   | Enhanced Touch   | Magic Resistance   | Invisibility   | Sub-Mariner   | Radiation Absorption   | Intuitive aptitude   | Vision - Microscopic   | Melting   | Wind Control   | Super Breath   | Wallcrawling   | Vision - Night   | Vision - Infrared   | Grim Reaping   | Matter Absorption   | The Force   | Resurrection   | Terrakinesis   | Vision - Heat   | Vitakinesis   | Radar Sense   | Qwardian Power Ring   | Weather Control   | Vision - X-Ray   | Vision - Thermal   | Web Creation   | Reality Warping   | Odin Force   | Symbiote Costume   | Speed Force   | Phoenix Force   | Molecular Dissipation   | Vision - Cryo   | Omnipresent   | Omniscient   |
|:--------------|:----------|:----------------------|:---------------------|:------------------------|:------------------|:-------------|:----------|:--------------------|:---------|:---------------|:-----------------------|:---------------|:-----------------|:---------------------|:--------------------|:------------|:---------------|:-----------------|:--------------|:------------|:---------------|:----------------|:--------------|:----------------|:------------------|:----------|:----------------|:----------------|:------------|:-----------|:--------------|:-------------|:-------------------------|:----------------------|:-----------------|:-------------------------|:--------------|:----------------|:------------------|:--------------|:---------------|:--------|:---------------|:-------|:---------------|:---------------------|:--------------|:----------------|:-----------------------|:--------------|:-------------|:------------------|:----------|:--------------------|:-----------------------|:---------------|:-------------|:------------|:------------------|:-----------|:------------------|:--------------------|:---------------|:------------------|:---------------|:----------|:------------------|:--------------------|:-----------------|:-------------|:----------------------|:-------------------------------|:-----------------------|:------------------------|:----------------|:------------|:---------------|:---------------|:------------------|:-------------------|:-------------------|:-------------|:-----------|:---------------|:-----------------|:----------------|:----------------|:-----------------|:-------------------------|:------------------|:-------------|:----------|:-------------|:-------------|:---------------------------|:------------------|:---------------|:----------------|:---------------|:-------------|:----------------------------|:---------|:----------------------|:------------------|:------------------|:--------------|:-----------------|:------------|:-----------------|:--------------------|:---------------|:-------------|:-----------|:-----------------|:---------------|:-------------|:----------------|:---------------------|:----------------------|:-------------------------------|:--------------------|:--------------------|:-----------------------|:-----------------------|:-----------------|:------------------|:------------|:--------------------------|:----------------|:--------|:---------------|:--------------------|:-----------------|:-------------------|:---------------|:--------------|:-----------------------|:---------------------|:-----------------------|:----------|:---------------|:---------------|:---------------|:-----------------|:--------------------|:---------------|:--------------------|:------------|:---------------|:---------------|:----------------|:--------------|:--------------|:----------------------|:------------------|:-----------------|:-------------------|:---------------|:------------------|:-------------|:-------------------|:--------------|:----------------|:------------------------|:----------------|:--------------|:-------------|
| 3-D Man       | True      | False                 | False                | False                   | False             | False        | False     | False               | False    | False          | False                  | False          | False            | False                | False               | False       | False          | True             | False         | False       | False          | False           | False         | False           | False             | True      | False           | False           | False       | False      | True          | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | False         | False        | False             | False     | False               | False                  | False          | False        | False       | False             | False      | False             | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | False       | False          | False          | False             | False              | False              | False        | False      | False          | False            | False           | False           | False            | False                    | False             | False        | False     | False        | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | False                 | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| A-Bomb        | False     | True                  | False                | False                   | False             | True         | False     | False               | False    | False          | False                  | False          | False            | False                | False               | True        | False          | True             | False         | False       | False          | False           | False         | False           | False             | True      | False           | False           | False       | False      | False         | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | False         | True         | False             | False     | False               | False                  | False          | False        | False       | False             | False      | False             | False               | False          | True              | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | False       | False          | False          | False             | False              | False              | False        | False      | False          | False            | False           | False           | False            | False                    | False             | False        | False     | False        | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | False                 | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| Abe Sapien    | True      | True                  | False                | False                   | True              | True         | False     | False               | False    | False          | True                   | True           | True             | False                | False               | True        | True           | True             | False         | True        | False          | False           | False         | False           | False             | True      | False           | False           | False       | False      | False         | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | True          | False        | False             | False     | False               | False                  | False          | False        | False       | False             | True       | False             | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | False       | False          | False          | False             | False              | False              | False        | False      | False          | False            | False           | False           | True             | False                    | False             | False        | False     | False        | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | False                 | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | True          | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| Abin Sur      | False     | False                 | True                 | False                   | False             | False        | False     | False               | False    | False          | False                  | False          | False            | False                | False               | False       | False          | False            | False         | False       | False          | False           | False         | False           | False             | False     | False           | False           | False       | False      | False         | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | False         | False        | False             | False     | False               | False                  | False          | False        | False       | False             | False      | False             | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | False       | False          | False          | False             | False              | False              | False        | False      | False          | False            | False           | False           | False            | False                    | False             | False        | False     | False        | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | False                 | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| Abomination   | False     | True                  | False                | False                   | False             | False        | False     | False               | False    | False          | False                  | False          | False            | False                | False               | False       | True           | True             | False         | False       | False          | False           | False         | False           | False             | True      | False           | False           | False       | False      | True          | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | False         | False        | False             | False     | False               | False                  | False          | False        | False       | False             | False      | True              | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | True        | False          | False          | False             | False              | False              | False        | False      | False          | False            | False           | False           | False            | False                    | False             | False        | False     | False        | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | False                 | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | True           | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| Abraxas       | False     | False                 | False                | True                    | False             | False        | False     | False               | True     | False          | False                  | False          | False            | False                | False               | False       | True           | True             | False         | False       | False          | False           | False         | True            | False             | False     | False           | False           | False       | False      | True          | False        | False                    | False                 | False            | False                    | False         | True            | False             | False         | False          | True    | False          | False  | False          | True                 | False         | False           | False                  | True          | False        | False             | False     | False               | False                  | False          | False        | False       | False             | False      | True              | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | False       | False          | False          | False             | False              | False              | False        | False      | False          | False            | False           | False           | False            | True                     | False             | False        | False     | False        | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | True                  | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | True           | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| Absorbing Man | False     | False                 | False                | False                   | True              | True         | False     | True                | False    | False          | False                  | False          | False            | False                | False               | False       | False          | True             | False         | False       | False          | False           | False         | False           | False             | False     | False           | False           | False       | False      | False         | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | False         | False        | False             | False     | False               | False                  | False          | False        | False       | False             | False      | True              | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | True                           | False                  | False                   | False           | False       | False          | False          | True              | False              | False              | False        | False      | False          | False            | True            | False           | False            | True                     | False             | False        | False     | False        | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | False                 | True              | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | True                | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| Adam Monroe   | False     | True                  | False                | False                   | False             | False        | False     | False               | False    | False          | False                  | False          | False            | False                | False               | False       | False          | False            | False         | False       | False          | False           | False         | False           | False             | False     | False           | False           | False       | False      | False         | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | True          | False        | False             | False     | False               | False                  | False          | False        | False       | False             | False      | False             | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | False       | False          | False          | False             | False              | False              | False        | False      | False          | False            | False           | False           | False            | False                    | False             | False        | False     | False        | False        | False                      | False             | True           | False           | False          | False        | False                       | False    | False                 | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| Adam Strange  | False     | False                 | False                | False                   | False             | True         | True      | False               | True     | False          | False                  | True           | True             | False                | False               | False       | True           | False            | False         | False       | False          | False           | False         | False           | False             | False     | False           | False           | False       | False      | True          | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | False         | False        | False             | False     | False               | False                  | False          | False        | False       | False             | False      | False             | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | False       | False          | False          | True              | False              | False              | False        | False      | False          | False            | False           | False           | True             | False                    | False             | False        | False     | True         | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | False                 | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |
| Agent Bob     | False     | False                 | False                | False                   | False             | False        | True      | False               | False    | False          | False                  | False          | False            | False                | False               | False       | False          | False            | False         | False       | False          | False           | False         | False           | False             | False     | False           | False           | False       | False      | False         | False        | False                    | False                 | False            | False                    | False         | False           | False             | False         | False          | False   | False          | False  | False          | False                | False         | False           | False                  | False         | False        | False             | False     | False               | False                  | False          | False        | False       | False             | False      | False             | False               | False          | False             | False          | False     | False             | False               | False            | False        | False                 | False                          | False                  | False                   | False           | False       | False          | False          | False             | False              | False              | False        | False      | False          | False            | False           | False           | False            | False                    | False             | False        | False     | False        | False        | False                      | False             | False          | False           | False          | False        | False                       | False    | False                 | False             | False             | False         | False            | False       | False            | False               | False          | False        | False      | False            | False          | False        | False           | False                | False                 | False                          | False               | False               | False                  | False                  | False            | False             | False       | False                     | False           | False   | False          | False               | False            | False              | False          | False         | False                  | False                | False                  | False     | False          | False          | False          | False            | False               | False          | False               | False       | False          | False          | False           | False         | False         | False                 | False             | False            | False              | False          | False             | False        | False              | False         | False           | False                   | False           | False         | False        |


Target Schema:
|   Publisher |
|------------:|
|         166 |
|          97 |
|          10 |
|           7 |
|           7 |
|           7 |
|           3 |
|           3 |
|           3 |
|           2 |

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