Skip to content

Commit

Permalink
Insert missing years for temporal stats on wind and pv
Browse files Browse the repository at this point in the history
  • Loading branch information
nesnoj committed Apr 25, 2024
1 parent a0d87e4 commit 9e28a22
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apipe/store/datasets/bnetza_mastr_pv_ground_region/create.smk
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,10 @@ rule create_development_over_time:
df_combined["capacity_net"] = (
df_combined["capacity_net"].div(1e3).round(1)
)
# Fill missing years by using values from year before
df_combined = df_combined.set_index("year").reindex(
range(df_combined["year"].min(), df_combined["year"].max() + 1)
).ffill().reset_index()

df_combined["year"] = df_combined["year"].astype(int)
df_combined.to_csv(output[0], index=False)
5 changes: 5 additions & 0 deletions apipe/store/datasets/bnetza_mastr_pv_roof_region/create.smk
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,10 @@ rule create_development_over_time:
df_combined["capacity_net"] = (
df_combined["capacity_net"].div(1e3).round(1)
)
# Fill missing years by using values from year before
df_combined = df_combined.set_index("year").reindex(
range(df_combined["year"].min(), df_combined["year"].max() + 1)
).ffill().reset_index()

df_combined["year"] = df_combined["year"].astype(int)
df_combined.to_csv(output[0], index=False)
5 changes: 5 additions & 0 deletions apipe/store/datasets/bnetza_mastr_wind_region/create.smk
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,10 @@ rule create_development_over_time:
df_combined["capacity_net"] = (
df_combined["capacity_net"].div(1e3).round(1)
)
# Fill missing years by using values from year before
df_combined = df_combined.set_index("year").reindex(
range(df_combined["year"].min(), df_combined["year"].max() + 1)
).ffill().reset_index()

df_combined["year"] = df_combined["year"].astype(int)
df_combined.to_csv(output[0], index=False)

0 comments on commit 9e28a22

Please sign in to comment.