Skip to content

Commit

Permalink
fs.to_dataframe column order fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
elphick committed Nov 5, 2024
1 parent 13e7c3e commit 1a9bca1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elphick/geomet/flowsheet/flowsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def to_dataframe(self, stream_names: Optional[list[str]] = None, tidy: bool = Tr

results: pd.DataFrame = pd.concat(chunks, axis='index').set_index('name', append=True)
if not tidy: # wide format
results = results.unstack(level='name', sort=False)
results = results.unstack(level='name')
column_order: list[str] = [f'{name}_{attr}' for name in results.columns.levels[1] for attr in
results.columns.levels[0]]
results.columns = [f'{col[1]}_{col[0]}' for col in results.columns]
Expand Down

0 comments on commit 1a9bca1

Please sign in to comment.