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                 | Position         |   Age | Team_from       | League_from        | Team_to         | League_to      | Season    |   Market_value |   Transfer_fee |
|:---------------------|:-----------------|------:|:----------------|:-------------------|:----------------|:---------------|:----------|---------------:|---------------:|
| Davi                 | Centre-Forward   |    25 | Nagoya Grampus  | J1 League          | Umm Salal       | Qatar          | 2009-2010 |       3e+06    |        5700000 |
| James Collins        | Centre-Back      |    26 | West Ham        | Premier League     | Aston Villa     | Premier League | 2009-2010 |       2e+06    |        5700000 |
| Bryan Ruíz           | Left Midfield    |    23 | KAA Gent        | Jupiler Pro League | FC Twente       | Eredivisie     | 2009-2010 |       5e+06    |        5500000 |
| Ikechukwu Uche       | Centre-Forward   |    25 | Getafe CF       | LaLiga             | Real Zaragoza   | LaLiga         | 2009-2010 |       4e+06    |        5500000 |
| Sergio Asenjo        | Goalkeeper       |    20 | Real Valladolid | LaLiga             | Atlético Madrid | LaLiga         | 2009-2010 |       4e+06    |        5500000 |
| Lorenzo De Silvestri | Right-Back       |    21 | Lazio           | Serie A            | Fiorentina      | Serie A        | 2009-2010 |       3.2e+06  |        5500000 |
| Ismail Köybasi       | Left-Back        |    20 | Gaziantepspor   | Süper Lig          | Besiktas        | Süper Lig      | 2009-2010 |       2.5e+06  |        5500000 |
| Falcao               | Centre-Forward   |    23 | River Plate     | Torneo Final       | FC Porto        | Liga NOS       | 2009-2010 |       6.5e+06  |        5430000 |
| Houssine Kharja      | Central Midfield |    26 | Siena           | Serie A            | Genoa           | Serie A        | 2009-2010 |       4e+06    |        5200000 |
| James McCarthy       | Central Midfield |    18 | Hamilton Acad.  | Premiership        | Wigan           | Premier League | 2009-2010 |       1.25e+06 |        5100000 |


Target Schema:
| Name              | Position         |   Age | Team_from      | League_from    | Team_to      | League_to      | Season    | Market_value   |   Transfer_fee |
|:------------------|:-----------------|------:|:---------------|:---------------|:-------------|:---------------|:----------|:---------------|---------------:|
| luís figo         | Right Winger     |    27 | FC Barcelona   | LaLiga         | Real Madrid  | LaLiga         | 2000-2001 |                |       60000000 |
| hernán crespo     | Centre-Forward   |    25 | Parma          | Serie A        | Lazio        | Serie A        | 2000-2001 |                |       56810000 |
| marc overmars     | Left Winger      |    27 | Arsenal        | Premier League | FC Barcelona | LaLiga         | 2000-2001 |                |       40000000 |
| gabriel batistuta | Centre-Forward   |    31 | Fiorentina     | Serie A        | AS Roma      | Serie A        | 2000-2001 |                |       36150000 |
| nicolas anelka    | Centre-Forward   |    21 | Real Madrid    | LaLiga         | Paris SG     | Ligue 1        | 2000-2001 |                |       34500000 |
| rio ferdinand     | Centre-Back      |    22 | West Ham       | Premier League | Leeds        | Premier League | 2000-2001 |                |       26000000 |
| flávio conceicao  | Central Midfield |    26 | Dep. La Coruña | LaLiga         | Real Madrid  | LaLiga         | 2000-2001 |                |       25000000 |
| savo milosevic    | Centre-Forward   |    26 | Real Zaragoza  | LaLiga         | Parma        | Serie A        | 2000-2001 |                |       25000000 |
| david trézéguet   | Centre-Forward   |    22 | Monaco         | Ligue 1        | Juventus     | Serie A        | 2000-2001 |                |       23240000 |
| claudio lópez     | Centre-Forward   |    25 | Valencia CF    | LaLiga         | Lazio        | Serie A        | 2000-2001 |                |       23000000 |

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