Skip to content

Commit

Permalink
Keep order of columns for model and agent vars DataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickJadoul committed Jan 24, 2021
1 parent 8823e13 commit 2b8dbdb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesa/batchrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ def _prepare_report_table(self, vars_dict, extra_cols=None):
column as a key.
"""
extra_cols = ["Run"] + (extra_cols or [])
index_cols = set()
for params in self.parameters_list:
index_cols |= params.keys()
index_cols = list(index_cols) + extra_cols
index_cols = []
if self.parameters_list:
index_cols = list(self.parameters_list[0].keys())
index_cols += extra_cols

records = []
for param_key, values in vars_dict.items():
Expand Down

0 comments on commit 2b8dbdb

Please sign in to comment.