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:
|   CustomerID | Title   | FirstName   | MiddleName   | LastName   | Suffix   | AddressLine1        | AddressLine2   | City          | StateProvinceName   | CountryRegionName   |   PostalCode | PhoneNumber         | BirthDate   | Education   | Occupation   | Gender   | MaritalStatus   |   HomeOwnerFlag |   NumberCarsOwned |   NumberChildrenAtHome |   TotalChildren |   YearlyIncome |
|-------------:|:--------|:------------|:-------------|:-----------|:---------|:--------------------|:---------------|:--------------|:--------------------|:--------------------|-------------:|:--------------------|:------------|:------------|:-------------|:---------|:----------------|----------------:|------------------:|-----------------------:|----------------:|---------------:|
|        11000 |         | Jon         | V            | Yang       |          | 3761 N. 14th St     |                | Rockhampton   | Queensland          | Australia           |         4700 | 1 (11) 500 555-0162 | 1966-04-08  | Bachelors   | Professional | M        | M               |               1 |                 0 |                      0 |               2 |         137947 |
|        11001 |         | Eugene      | L            | Huang      |          | 2243 W St.          |                | Seaford       | Victoria            | Australia           |         3198 | 1 (11) 500 555-0110 | 1965-05-14  | Bachelors   | Professional | M        | S               |               0 |                 1 |                      3 |               3 |         101141 |
|        11002 |         | Ruben       |              | Torres     |          | 5844 Linden Land    |                | Hobart        | Tasmania            | Australia           |         7001 | 1 (11) 500 555-0184 | 1965-08-12  | Bachelors   | Professional | M        | M               |               1 |                 1 |                      3 |               3 |          91945 |
|        11003 |         | Christy     |              | Zhu        |          | 1825 Village Pl.    |                | North Ryde    | New South Wales     | Australia           |         2113 | 1 (11) 500 555-0162 | 1968-02-15  | Bachelors   | Professional | F        | S               |               0 |                 1 |                      0 |               0 |          86688 |
|        11004 |         | Elizabeth   |              | Johnson    |          | 7553 Harness Circle |                | Wollongong    | New South Wales     | Australia           |         2500 | 1 (11) 500 555-0131 | 1968-08-08  | Bachelors   | Professional | F        | S               |               1 |                 4 |                      5 |               5 |          92771 |
|        11005 |         | Julio       |              | Ruiz       |          | 7305 Humphrey Drive |                | East Brisbane | Queensland          | Australia           |         4169 | 1 (11) 500 555-0151 | 1965-08-05  | Bachelors   | Professional | M        | S               |               1 |                 1 |                      0 |               0 |         103199 |
|        11006 |         | Janet       | G            | Alvarez    |          | 2612 Berry Dr       |                | Matraville    | New South Wales     | Australia           |         2036 | 1 (11) 500 555-0184 | 1965-12-06  | Bachelors   | Professional | F        | S               |               1 |                 1 |                      0 |               0 |          84756 |
|        11007 |         | Marco       |              | Mehta      |          | 942 Brook Street    |                | Warrnambool   | Victoria            | Australia           |         3280 | 1 (11) 500 555-0126 | 1964-05-09  | Bachelors   | Professional | M        | M               |               1 |                 2 |                      3 |               3 |         109759 |
|        11008 |         | Rob         |              | Verhoff    |          | 624 Peabody Road    |                | Bendigo       | Victoria            | Australia           |         3550 | 1 (11) 500 555-0164 | 1964-07-07  | Bachelors   | Professional | F        | S               |               1 |                 3 |                      4 |               4 |          88005 |
|        11009 |         | Shannon     | C            | Carlson    |          | 3839 Northgate Road |                | Hervey Bay    | Queensland          | Australia           |         4655 | 1 (11) 500 555-0110 | 1964-04-01  | Bachelors   | Professional | M        | S               |               0 |                 1 |                      0 |               0 |         106399 |


Table #2
Filename: source_1.csv
Sample Rows in Markdown:
|   CustomerID |   BikeBuyer |
|-------------:|------------:|
|        11000 |           0 |
|        11001 |           1 |
|        11002 |           0 |
|        11003 |           0 |
|        11004 |           1 |
|        11005 |           1 |
|        11006 |           1 |
|        11007 |           1 |
|        11008 |           1 |
|        11009 |           0 |


Table #3
Filename: source_2.csv
Sample Rows in Markdown:
|   CustomerID |   AveMonthSpend |
|-------------:|----------------:|
|        20221 |              61 |
|        20222 |              94 |
|        20223 |             159 |
|        20224 |             169 |
|        20225 |              51 |
|        20226 |              55 |
|        20227 |              85 |
|        20228 |              91 |
|        20229 |             112 |
|        20230 |             125 |


Target Schema:
|   CustomerID | Title   | FirstName   | MiddleName   | LastName   | Suffix   | AddressLine1        | AddressLine2   | City          | StateProvinceName   | CountryRegionName   |   PostalCode | PhoneNumber         | BirthDate   | Education   | Occupation   | Gender   | MaritalStatus   |   HomeOwnerFlag |   NumberCarsOwned |   NumberChildrenAtHome |   TotalChildren |   YearlyIncome |   AveMonthSpend |   BikeBuyer |
|-------------:|:--------|:------------|:-------------|:-----------|:---------|:--------------------|:---------------|:--------------|:--------------------|:--------------------|-------------:|:--------------------|:------------|:------------|:-------------|:---------|:----------------|----------------:|------------------:|-----------------------:|----------------:|---------------:|----------------:|------------:|
|        11000 |         | Jon         | V            | Yang       |          | 3761 N. 14th St     |                | Rockhampton   | Queensland          | Australia           |         4700 | 1 (11) 500 555-0162 | 1966-04-08  | Bachelors   | Professional | M        | M               |               1 |                 0 |                      0 |               2 |         137947 |              89 |           0 |
|        11001 |         | Eugene      | L            | Huang      |          | 2243 W St.          |                | Seaford       | Victoria            | Australia           |         3198 | 1 (11) 500 555-0110 | 1965-05-14  | Bachelors   | Professional | M        | S               |               0 |                 1 |                      3 |               3 |         101141 |             117 |           1 |
|        11002 |         | Ruben       |              | Torres     |          | 5844 Linden Land    |                | Hobart        | Tasmania            | Australia           |         7001 | 1 (11) 500 555-0184 | 1965-08-12  | Bachelors   | Professional | M        | M               |               1 |                 1 |                      3 |               3 |          91945 |             123 |           0 |
|        11003 |         | Christy     |              | Zhu        |          | 1825 Village Pl.    |                | North Ryde    | New South Wales     | Australia           |         2113 | 1 (11) 500 555-0162 | 1968-02-15  | Bachelors   | Professional | F        | S               |               0 |                 1 |                      0 |               0 |          86688 |              50 |           0 |
|        11004 |         | Elizabeth   |              | Johnson    |          | 7553 Harness Circle |                | Wollongong    | New South Wales     | Australia           |         2500 | 1 (11) 500 555-0131 | 1968-08-08  | Bachelors   | Professional | F        | S               |               1 |                 4 |                      5 |               5 |          92771 |              95 |           1 |
|        11005 |         | Julio       |              | Ruiz       |          | 7305 Humphrey Drive |                | East Brisbane | Queensland          | Australia           |         4169 | 1 (11) 500 555-0151 | 1965-08-05  | Bachelors   | Professional | M        | S               |               1 |                 1 |                      0 |               0 |         103199 |              78 |           1 |
|        11006 |         | Janet       | G            | Alvarez    |          | 2612 Berry Dr       |                | Matraville    | New South Wales     | Australia           |         2036 | 1 (11) 500 555-0184 | 1965-12-06  | Bachelors   | Professional | F        | S               |               1 |                 1 |                      0 |               0 |          84756 |              54 |           1 |
|        11007 |         | Marco       |              | Mehta      |          | 942 Brook Street    |                | Warrnambool   | Victoria            | Australia           |         3280 | 1 (11) 500 555-0126 | 1964-05-09  | Bachelors   | Professional | M        | M               |               1 |                 2 |                      3 |               3 |         109759 |             130 |           1 |
|        11008 |         | Rob         |              | Verhoff    |          | 624 Peabody Road    |                | Bendigo       | Victoria            | Australia           |         3550 | 1 (11) 500 555-0164 | 1964-07-07  | Bachelors   | Professional | F        | S               |               1 |                 3 |                      4 |               4 |          88005 |              85 |           1 |
|        11009 |         | Shannon     | C            | Carlson    |          | 3839 Northgate Road |                | Hervey Bay    | Queensland          | Australia           |         4655 | 1 (11) 500 555-0110 | 1964-04-01  | Bachelors   | Professional | M        | S               |               0 |                 1 |                      0 |               0 |         106399 |              74 |           0 |

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