-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2579f43
commit b8e3b79
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import pandas as pd | ||
|
||
|
||
|
||
|
||
|
||
def combine_forecast_ground_truth(forecast_df, ground_truth_df): | ||
""" | ||
Combine the forecast results with the ground truth (ts, id, horizon (in hours), pred, truth, diff) | ||
forecast_df should have the following columns | ||
- timestamp | ||
- pv_id | ||
- horizon_hours | ||
- power | ||
ground_truth_df should have the following columns | ||
- timestamp | ||
- pv_id | ||
- horizon_hours | ||
- power | ||
""" | ||
|
||
# rename power to forecast_power | ||
forecast_df = forecast_df.rename(columns={"power": "forecast_power"}) | ||
|
||
# rename power to ground_truth_power | ||
ground_truth_df = ground_truth_df.rename(columns={"power": "ground_truth_power"}) | ||
|
||
# merge the two dataframes | ||
combined_df = pd.merge(forecast_df, ground_truth_df, on=["timestamp", "pv_id", "horizon_hours"]) | ||
|
||
return combined_df | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters