Skip to content

Commit

Permalink
Fix problem if index is named
Browse files Browse the repository at this point in the history
If index was name the previous code returned and empty DataFrame.
Certainly due to conflict between index only name give to series
and new column name
  • Loading branch information
RobinsonBeaucour committed Sep 27, 2024
1 parent 7c1466c commit 612d25e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions heatpro/demand_profile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ def apply_weekly_hourly_pattern(hourly_index: pd.DatetimeIndex, hourly_mapping:
pd.DataFrame: DataFrame weight correct format
"""
return pd.DataFrame(
pd.Series(hourly_index,index = hourly_index,).apply(lambda x: hourly_mapping.get((x.dayofweek, x.hour), 1)),
columns = [WEIGHT_NAME_REQUIRED],
pd.Series(hourly_index,index = hourly_index,).apply(lambda x: hourly_mapping.get((x.dayofweek, x.hour), 1))\
.rename(WEIGHT_NAME_REQUIRED)
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "heatpro"
version = "0.1.4"
version = "0.1.5"
description = "Generate heat demand load profile for distict heating"
authors = ["Robinson Beaucour <[email protected]>",
"Nicolas Lamaison <[email protected]>",
Expand Down

0 comments on commit 612d25e

Please sign in to comment.