Skip to content

Commit

Permalink
fast translate: handle 'truth value of an array' error
Browse files Browse the repository at this point in the history
  • Loading branch information
pcoccoli committed Jun 16, 2023
1 parent 2babde1 commit 76f70cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firepit/aio/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def translate(
for new_col, orig_cols in group.items():
# Combine columns into single list column
logger.debug('Group %s into "%s"', orig_cols, new_col)
df[new_col] = df[orig_cols].agg(lambda x: [i for i in list(x) if not pd.isna(i)], axis=1) #.values.tolist()
df[new_col] = [[i for i in row if i == i or not pd.isna(i)] for row in df[orig_cols].values.tolist()]
df = df.drop(orig_cols, axis=1)

# Run transformers
Expand Down

0 comments on commit 76f70cf

Please sign in to comment.