Skip to content

Commit

Permalink
update flatten function: using dict comprehension
Browse files Browse the repository at this point in the history
Co-authored-by: Eduardo Cuducos <4732915+cuducos@users.noreply.github.com>
  • Loading branch information
FelipeSBarros and cuducos authored Feb 14, 2024
1 parent 1938c31 commit 7bc14fd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crossfire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ def flatten(data, nested_columns=None):
keys = set(data.keys()) & nested_columns
flattened_dict = {}
for key in keys:
for k, v in data.get(key).items():
flattened_dict.update({f"{key}_{k}": v})
flattened_dict.update({f"{key}_{k}": v for k, v in data.get(key).items()})
return flattened_dict

0 comments on commit 7bc14fd

Please # to comment.