Skip to content

Commit

Permalink
Correct merger of pandas dataframes in ElecSLP
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Jan 24, 2021
1 parent 6100779 commit 746caba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions demandlib/bdew.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ def create_bdew_load_profiles(self, dt_index, slp_types, holidays=None):
self.seasons[p][1], 0, 0)
b = datetime.datetime(self.year, self.seasons[p][2],
self.seasons[p][3], 23, 59)
period_df = tmp_df[tmp_df['period'] == p[:-1]]
season_df = time_df[a:b]
new_df.update(pd.DataFrame.merge(
tmp_df[tmp_df['period'] == p[:-1]], time_df[a:b],
period_df, season_df,
left_on=left_cols, right_on=right_cols,
how='inner', left_index=True).sort_index().drop(
how='inner').set_index(season_df.index).drop(
['hour_of_day'], 1))

new_df.drop('date', axis=1, inplace=True)
Expand Down

0 comments on commit 746caba

Please sign in to comment.