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:
| amazon_product_url                                                                             | author             | title                     | description                                                                                                                                                          |   bestsellers_date |   published_date | publisher        |   rank_on_list |   rank_last_week |   weeks_on_list |
|:-----------------------------------------------------------------------------------------------|:-------------------|:--------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------:|-----------------:|:-----------------|---------------:|-----------------:|----------------:|
| http://www.amazon.com/Golden-Commissario-Guido-Brunetti-Mysteries/dp/0802121012?tag=NYTBS-20   | Donna Leon         | THE GOLDEN EGG            | Venice’s Commissario Guido Brunetti looks into the suspicious death of a deaf and mentally disabled man.                                                             |      1365206400000 |    1366502400000 | Atlantic Monthly |             18 |                0 |               0 |
| http://www.amazon.com/No-Way-Back-A-Novel/dp/0061655988?tag=NYTBS-20                           | Andrew Gross       | NO WAY BACK               |                                                                                                                                                                      |      1365206400000 |    1366502400000 | Morrow           |             19 |                0 |               0 |
| http://www.amazon.com/Breaking-Point-Joe-Pickett-Novel/dp/0425264602?tag=NYTBS-20              | C J Box            | BREAKING POINT            | The Wyoming game warden Joe Pickett gets in the line of fire between an old friend and the Environmental Protection Agency.                                          |      1365206400000 |    1366502400000 | Putnam           |             20 |                0 |               0 |
| http://www.amazon.com/Daddys-Gone-Hunting-Higgins-Clark-ebook/dp/B009R659L8?tag=NYTBS-20       | Mary Higgins Clark | DADDY'S GONE A HUNTING    | Two sisters are threatened by a dark secret from their family's past.                                                                                                |      1365811200000 |    1367107200000 | Simon & Schuster |              1 |                0 |               1 |
| http://www.amazon.com/Dont-Go-Lisa-Scottoline-ebook/dp/B008BU6THE?tag=NYTBS-20                 | Lisa Scottoline    | DON'T GO                  | An Army doctor returns from Afghanistan when his wife dies in what at first appears to be an accident, and finds that his life is falling apart.                     |      1365811200000 |    1367107200000 | St. Martin's     |              2 |                0 |               1 |
| http://www.amazon.com/Life-After-A-Novel-ebook/dp/B008TUQ60G?tag=NYTBS-20                      | Kate Atkinson      | LIFE AFTER LIFE           | A woman appears in different versions of the same events, centered on World War II.                                                                                  |      1365811200000 |    1367107200000 | Little, Brown    |              3 |                3 |               2 |
| http://www.amazon.com/Unintended-Consequences-Stone-Barrington-Book/dp/0399159878?tag=NYTBS-20 | Stuart Woods       | UNINTENDED CONSEQUENCES   | The New York lawyer Stone Barrington discovers a shadowy network beneath the world of European wealth.                                                               |      1365811200000 |    1367107200000 | Putnam           |              4 |                0 |               1 |
| http://www.amazon.com/The-Burgess-Boys-A-Novel-ebook/dp/B009MYAWIA?tag=NYTBS-20                | Elizabeth Strout   | THE BURGESS BOYS          | Two brothers, both lawyers, come together in a small Maine town to defend their good-for-nothing nephew; by the Pulitzer Prize-winning author of “Olive Kitteridge.” |      1365811200000 |    1367107200000 | Random House     |              5 |                4 |               3 |
| http://www.amazon.com/Manuscript-Found-Accra-Paulo-Coelho/dp/0385349831?tag=NYTBS-20           | Paulo Coelho       | MANUSCRIPT FOUND IN ACCRA | The wisdom of a wise man known as the Copt, set in Jerusalem just before the Crusaders’ invasion in 1099.                                                            |      1365811200000 |    1367107200000 | Knopf            |              6 |                2 |               2 |
| http://www.amazon.com/Gone-Girl-Novel-Gillian-Flynn-ebook/dp/B006LSZECO?tag=NYTBS-20           | Gillian Flynn      | GONE GIRL                 | A woman disappears on her fifth anniversary; is her husband a killer?                                                                                                |      1365811200000 |    1367107200000 | Crown            |              7 |                6 |              45 |


Target Schema:
| title                    |   min_rank |   max_weeks_on_list |
|:-------------------------|-----------:|--------------------:|
| 10TH ANNIVERSARY         |         16 |                   8 |
| 11/22/63                 |          1 |                   9 |
| 11TH HOUR                |          1 |                   8 |
| 1225 CHRISTMAS TREE LANE |         10 |                   4 |
| 1356                     |         11 |                   1 |
| 15 SECONDS               |         18 |                   0 |
| 1Q84                     |         10 |                   9 |
| 2030                     |         14 |                   3 |
| 206 BONES                |         12 |                   4 |
| 2312                     |         20 |                   0 |

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