Skip to content

Commit

Permalink
fix: try to handle lists of lists in pandas loader
Browse files Browse the repository at this point in the history
  • Loading branch information
andnp committed Dec 7, 2024
1 parent cb28842 commit 8bca395
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PyExpUtils/results/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ def _flattenKeys(d: Dict[str, Any]):
for sk, sv in _flattenKeys(v).items():
out[f'{k}.{sk}'] = sv

# if we have a list of lists, add top-level list as key
elif isinstance(v, list) and isinstance(v[0], list):
for i, sv in enumerate(v):
out[f'{k}.[{i}]'] = sv

# if we have a list of objects, keep digging
elif isinstance(v, list) and isinstance(v[0], dict):
for i, sv in enumerate(v):
Expand Down

0 comments on commit 8bca395

Please sign in to comment.