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:
| Artist                   |   Year Inducted | Years Waited   | # of Years Nominated   | Inducted By     |
|:-------------------------|----------------:|:---------------|:-----------------------|:----------------|
| Bon Jovi                 |            2018 | 9              | 2                      | Howard Stern    |
| The Cars                 |            2018 | 14             | 3                      | Brandon Flowers |
| Dire Straits             |            2018 | 14             | 1                      | (self-inducted) |
| The Moody Blues          |            2018 | 28             | 1                      | Ann Wilson      |
| Nina Simone              |            2018 | 32             | 1                      | Mary J. Blige   |
| Sister Rosetta Tharpe    |            2018 | *              | *                      | Brittany Howard |
| 2Pac                     |            2017 | 0              | 1                      | Snoop Dogg      |
| Electric Light Orchestra |            2017 | 20             | 1                      | Dhani Harrison  |
| Joan Baez                |            2017 | 31             | 1                      | Jackson Browne  |
| Journey                  |            2017 | 16             | 1                      | Pat Monahan     |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| Artist               |   Influenced |
|:---------------------|-------------:|
| 2Pac                 |           39 |
| A Tribe Called Quest |           26 |
| ABBA                 |           19 |
| AC/DC                |          121 |
| Aerosmith            |           24 |
| Afrika Bambaataa     |           15 |
| Al Green             |           20 |
| Albert King          |           11 |
| Alice Cooper         |           20 |
| Alice In Chains      |           19 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| Artist                      | Year Inducted   |   Years Waited |   # of Years Nominated |
|:----------------------------|:----------------|---------------:|-----------------------:|
| Afrika Bambaataa            |                 |             14 |                      1 |
| Alice In Chains             |                 |              3 |                      0 |
| Bad Brains                  |                 |             12 |                      1 |
| Bad Company                 |                 |             20 |                      0 |
| Barry White                 |                 |             21 |                      0 |
| Bauhaus                     |                 |             15 |                      0 |
| Ben E. King                 |                 |             32 |                      3 |
| Big Mama Thornton           |                 |             42 |                      0 |
| Big Star                    |                 |             22 |                      0 |
| Billy Ward and his Dominoes |                 |             43 |                      1 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| Artist          |   Certified Units (Millions) |
|:----------------|-----------------------------:|
| Vince Gill      |                         24   |
| Whitesnake      |                         12.5 |
| Whitney Houston |                         58.5 |
| Will Smith      |                         12   |
| Willie Nelson   |                         31.5 |
| Yanni           |                         11   |
| Yes             |                         13.5 |
| ZZ Top          |                         25   |
| Al Green        |                          6   |
| Albert King     |                          0   |


Target Schema:
| Artist                   |   Year Inducted |   Years Waited |   # of Years Nominated | Inducted By     |   Influenced |   Certified Units (Millions) |
|:-------------------------|----------------:|---------------:|-----------------------:|:----------------|-------------:|-----------------------------:|
| Bon Jovi                 |            2018 |              9 |                      2 | Howard Stern    |           15 |                         34.5 |
| The Cars                 |            2018 |             14 |                      3 | Brandon Flowers |           17 |                         23.5 |
| Dire Straits             |            2018 |             14 |                      1 | (self-inducted) |           19 |                         15.5 |
| The Moody Blues          |            2018 |             28 |                      1 | Ann Wilson      |           15 |                         10   |
| 2Pac                     |            2017 |              0 |                      1 | Snoop Dogg      |           39 |                         36.5 |
| Electric Light Orchestra |            2017 |             20 |                      1 | Dhani Harrison  |           14 |                         10   |
| Journey                  |            2017 |             16 |                      1 | Pat Monahan     |           14 |                         48   |
| Pearl Jam                |            2017 |              0 |                      1 | David Letterman |           18 |                         31.5 |
| Chicago                  |            2016 |             21 |                      1 | Rob Thomas      |           14 |                         38.5 |
| Steve Miller             |            2016 |             22 |                      1 | The Black Keys  |           11 |                         25.5 |

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