Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Oct 15, 2023
2 parents fa6ab6f + 5679b6a commit f7d5de0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions unfold/unfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,9 @@ def format_dataframe(
filepath = self.package.get_resource("scenario_data").source
# ensure that all slashes in filepath are forward slashes
filepath = filepath.replace("\\", "/")
self.scenario_df = pd.read_csv(filepath, keep_default_na=False, na_values="", encoding="utf-8-sig")
self.scenario_df = pd.read_csv(
filepath, keep_default_na=False, na_values="", encoding="utf-8-sig"
)

# Drop columns corresponding to scenarios that were removed.
self.scenario_df = self.scenario_df.drop(scenarios_to_leave_out, axis=1)
Expand Down Expand Up @@ -1045,7 +1047,6 @@ def format_superstructure_dataframe(self) -> None:
for scenario, val in factor.items():
factor[scenario] = val * _(matrix[supplier_idx, consumer_idx])


# Create a new scenario dataframe from the updated factors dictionary
self.scenario_df = pd.DataFrame.from_dict(self.factors).T.reset_index()

Expand Down

0 comments on commit f7d5de0

Please sign in to comment.