Skip to content

Commit

Permalink
refactoring to pass linter
Browse files Browse the repository at this point in the history
  • Loading branch information
liesenf committed Sep 4, 2024
1 parent 46f6183 commit 48b341a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sktalk/corpus/write/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ def _metadata_to_df(cls, metadata: dict):
df = pd.DataFrame(norm)

def process_element(x):
if isinstance(x, list):
return ', '.join(x)
elif isinstance(x, dict):
return json.dumps(x) # or ', '.join([f'{k}: {v}' for k, v in x.items()])
else:
if isinstance(x, list):
return ', '.join(x)
if isinstance(x, dict):
return json.dumps(x) # or ', '.join([f'{k}: {v}' for k, v in x.items()])
return x

df[:] = np.vectorize(process_element)(df)
Expand Down

0 comments on commit 48b341a

Please sign in to comment.