diff --git a/src/nested_pandas/utils/utils.py b/src/nested_pandas/utils/utils.py index ea17ce1..e337dcf 100644 --- a/src/nested_pandas/utils/utils.py +++ b/src/nested_pandas/utils/utils.py @@ -29,9 +29,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) - ) + counts = 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: # this may be able to be sped up using tolists() as well