Skip to content

Commit

Permalink
add rename fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dougbrn committed Jul 26, 2024
1 parent 55765d8 commit e6ddb46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nested_pandas/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def count_nested(df, nested, by=None, join=True) -> NestedFrame:
if by is None:
field_to_len = df[nested].nest.fields[0]
counts = (
df[nested].nest.to_lists().apply(lambda x: len(x[field_to_len]), axis=1) # .rename(f"n_{nested}")
df[nested].nest.to_lists().apply(lambda x: len(x[field_to_len]), axis=1)
)
counts.name = f"n_{nested}" # update name directly (rename causes issues downstream)
else:
Expand Down

0 comments on commit e6ddb46

Please sign in to comment.