albertvillanova HF staff commited on
Commit
da4a3b1
1 Parent(s): 6099782

Remove unnecessary iteration

Browse files
Files changed (1) hide show
  1. src/results.py +1 -1
src/results.py CHANGED
@@ -40,7 +40,7 @@ def load_results_dataframe(model_id, result_paths_per_model=None):
40
  data["results"].update(d["results"])
41
  data["configs"].update(d["configs"])
42
  model_name = d.get("model_name", "Model")
43
- df = pd.json_normalize([{key: value for key, value in data.items()}])
44
  # df.columns = df.columns.str.split(".") # .split return a list instead of a tuple
45
  return df.set_index(pd.Index([model_name])).reset_index()
46
 
 
40
  data["results"].update(d["results"])
41
  data["configs"].update(d["configs"])
42
  model_name = d.get("model_name", "Model")
43
+ df = pd.json_normalize([data])
44
  # df.columns = df.columns.str.split(".") # .split return a list instead of a tuple
45
  return df.set_index(pd.Index([model_name])).reset_index()
46