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               |   Score |
|:---------------------|--------:|
| 2Pac                 |    3.5  |
| A Tribe Called Quest |    4.25 |
| ABBA                 |    3.69 |
| AC/DC                |    3.69 |
| Adele                |    3.88 |
| Aerosmith            |    3.47 |
| Afrika Bambaataa     |    3.25 |
| Al Green             |    3.41 |
| Albert King          |    3.07 |
| Alice Cooper         |    3.43 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
| Artist               |   Albums in RS500 |
|:---------------------|------------------:|
| A Tribe Called Quest |                 1 |
| ABBA                 |                 1 |
| AC/DC                |                 2 |
| Aerosmith            |                 2 |
| Al Green             |                 3 |
| Albert King          |                 1 |
| Alice Cooper         |                 1 |
| Amy Winehouse        |                 1 |
| Arcade Fire          |                 1 |
| Arctic Monkeys       |                 1 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
| Artist                                       |   Top 100 Singles |   Highest Position |
|:---------------------------------------------|------------------:|-------------------:|
| Whirlwind                                    |                 1 |                 91 |
| Steve Harley & Cockney Rebel                 |                 1 |                 96 |
| The 'Unforgettable' Sound of Dick Hyman Trio |                 1 |                  8 |
| Techniques                                   |                 1 |                 29 |
| White Town                                   |                 1 |                 23 |
| Tuxedo Junction                              |                 1 |                 32 |
| Whitney Houston & CeCe Winans                |                 1 |                  8 |
| Toby Keith & Willie Nelson                   |                 1 |                 22 |
| Sunny & The Sunglows                         |                 1 |                 11 |
| Twennynine                                   |                 1 |                 83 |


Table #4
Filename: source_3.csv
Sample Rows in Markdown:
| Artist             |   Times on Cover of RS |
|:-------------------|-----------------------:|
| The Rolling Stones |                     40 |
| Bob Dylan          |                     24 |
| Bruce Springsteen  |                     24 |
| U2                 |                     22 |
| Madonna            |                     19 |
| The Beatles        |                     16 |
| Jimi Hendrix       |                     15 |
| The Grateful Dead  |                     14 |
| John Lennon        |                     14 |
| The Who            |                     12 |


Table #5
Filename: source_4.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 #6
Filename: source_5.csv
Sample Rows in Markdown:
| Artist       |   Certified Units (Millions) |
|:-------------|-----------------------------:|
| 2Pac         |                         36.5 |
| 3 Doors Down |                         12   |
| 50 Cent      |                         11.5 |
| ABBA         |                         10.5 |
| AC/DC        |                         72   |
| Ace Of Base  |                         10   |
| Adele        |                         28   |
| Aerosmith    |                         66.5 |
| Alabama      |                         46.5 |
| Alan Jackson |                         43.5 |


Table #7
Filename: source_6.csv
Sample Rows in Markdown:
| Artist          |   Spotify |
|:----------------|----------:|
| The Beatles     |  15022354 |
| Elvis Presley   |   7518562 |
| The Eagles      |   8989332 |
| Led Zeppelin    |  10306295 |
| Michael Jackson |  24068900 |
| Billy Joel      |   8659894 |
| Elton John      |  11485407 |
| Pink Floyd      |   8887597 |
| AC/DC           |  13190878 |
| Aerosmith       |   9932398 |


Table #8
Filename: source_7.csv
Sample Rows in Markdown:
| Artist                   | Year Inducted   |   Years Waited |   # of Years Nominated |
|:-------------------------|:----------------|---------------:|-----------------------:|
| Def Leppard              |                 |             13 |                      1 |
| Devo                     |                 |             15 |                      1 |
| Janet Jackson            |                 |             11 |                      3 |
| John Prine               |                 |             22 |                      1 |
| Kraftwerk                |                 |             23 |                      5 |
| LL Cool J                |                 |              9 |                      5 |
| MC5                      |                 |             27 |                      4 |
| Radiohead                |                 |              1 |                      2 |
| Rage Against the Machine |                 |              1 |                      2 |
| Roxy Music               |                 |             21 |                      1 |


Target Schema:
| Artist        | Year Inducted   |   Years Waited |   # of Years Nominated |   Influenced |   Certified Units (Millions) |   Albums in RS500 |   Top 100 Singles |   Highest Position |   Times on Cover of RS |   Score |   Spotify |
|:--------------|:----------------|---------------:|-----------------------:|-------------:|-----------------------------:|------------------:|------------------:|-------------------:|-----------------------:|--------:|----------:|
| Def Leppard   |                 |             13 |                      1 |           20 |                         35.5 |                 1 |                19 |                  1 |                      1 |    3.68 |   3415682 |
| Janet Jackson |                 |             11 |                      3 |           26 |                         26   |                 2 |                36 |                  1 |                      3 |    3.23 |   4248668 |
| LL Cool J     |                 |              9 |                      5 |           14 |                         12.5 |                 1 |                26 |                  3 |                      1 |    3.23 |   2009491 |
| Radiohead     |                 |              1 |                      2 |          163 |                          6.5 |                 5 |                 3 |                 34 |                      5 |    4.17 |   8304956 |
| Roxy Music    |                 |             21 |                      1 |          160 |                          1   |                 2 |                 3 |                 30 |                      1 |    4.17 |   1181065 |

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
source_5.csv
source_6.csv
source_7.csv
test: test_0.csv
test_1.csv
test_2.csv
test_3.csv
test_4.csv
test_5.csv
test_6.csv
test_7.csv