[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-12-04 11:20:38 +00:00
parent f3fcd43eef
commit 92ccb517f3
3 changed files with 7 additions and 6 deletions

View File

@ -30,13 +30,14 @@ opt_name = {"Store": "e", "Line": "s", "Transformer": "s"}
def reindex_columns(df, cols): def reindex_columns(df, cols):
investments = cols.levels[3] investments = cols.levels[3]
if len(cols.names)!=len(df.columns.levels): if len(cols.names) != len(df.columns.levels):
df = pd.concat([df] * len(investments), axis=1) df = pd.concat([df] * len(investments), axis=1)
df.columns = cols df.columns = cols
df = df.reindex(cols, axis=1) df = df.reindex(cols, axis=1)
return df return df
def calculate_costs(n, label, costs): def calculate_costs(n, label, costs):
investments = n.investment_periods investments = n.investment_periods
cols = pd.MultiIndex.from_product( cols = pd.MultiIndex.from_product(