Skip to content

Commit

Permalink
improve performance of typicalPeriods creation in _rescaleClusterPeriods
Browse files Browse the repository at this point in the history
  • Loading branch information
fneum committed Aug 21, 2023
1 parent 42fef50 commit 8cf3e65
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tsam/timeseriesaggregation.py
Expand Up @@ -828,9 +828,10 @@ def _rescaleClusterPeriods(self, clusterOrder, clusterPeriods, extremeClusterIdx
series, without changing the values of the extremePeriods.
"""
weightingVec = pd.Series(self._clusterPeriodNoOccur).values
typicalPeriods = pd.DataFrame(
clusterPeriods, columns=self.normalizedPeriodlyProfiles.columns
)
typicalPeriods = pd.concat([
pd.Series(s, index=self.normalizedPeriodlyProfiles.columns)
for s in self.clusterPeriods
], axis=1).T
idx_wo_peak = np.delete(typicalPeriods.index, extremeClusterIdx)
for column in self.timeSeries.columns:
diff = 1
Expand Down

0 comments on commit 8cf3e65

Please sign in to comment.