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:
| Text Date   | Value Date   | Zip Code                                  |   Water Use |   Power Use |
|:------------|:-------------|:------------------------------------------|------------:|------------:|
| Jul_2007    | Jul-07       | 91311                                     |       52    |        1141 |
|             |              | (34.25282047300044, -118.5950275619997)   |             |             |
| Jan_2009    | Jan-09       | 90402                                     |       17.49 |        1102 |
|             |              | (34.03254172900046, -118.50584632399972)  |             |             |
| Dec_2011    | Dec-11       | 90305                                     |       10.62 |           0 |
|             |              | (33.95809005900048, -118.32920881499967)  |             |             |
| Feb_2010    | Feb-10       | 91344                                     |       12.78 |         604 |
|             |              | (34.274801855000476, -118.50113633899969) |             |             |
| Jan_2011    | Jan-11       | 90293                                     |       31.48 |         531 |
|             |              | (33.95744265300044, -118.43916786999972)  |             |             |
| May_2009    | May-09       | 90007                                     |       44.47 |         277 |
|             |              | (34.02833141800045, -118.28507659499968)  |             |             |
| Jul_2006    | Jul-06       | 91345                                     |       38.28 |         958 |
|             |              | (34.262123129000486, -118.46175755399969) |             |             |
| Oct_2008    | Oct-08       | 91601                                     |       27.97 |         413 |
|             |              | (34.167132618000494, -118.37252852099971) |             |             |
| Apr_2007    | Apr-07       | 90292                                     |       34.85 |         479 |
|             |              | (33.98163129900047, -118.4511079449997)   |             |             |
| Jan_2013    | Jan-13       | 91306                                     |       10.91 |         541 |
|             |              | (34.208401481000465, -118.5759399529997)  |             |             |


Target Schema:
| Date     |   Water Use |   Power Use |
|:---------|------------:|------------:|
| Apr_2006 |     4351.1  |       25274 |
| Apr_2007 |     6148.88 |       34389 |
| Apr_2008 |     4618.79 |       31594 |
| Apr_2009 |     3742.91 |       32715 |
| Apr_2010 |     4811.05 |       26682 |
| Apr_2011 |     3771.72 |       30445 |
| Apr_2012 |     2666.36 |       25277 |
| Apr_2013 |      749.73 |       22071 |
| Aug_2005 |     7045.65 |       43065 |
| Aug_2006 |     6740.96 |       42392 |

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