Skip to content

Conversation

GuruprashanthKrishnakumar
Copy link
Contributor

counts = ensure_int64(counts).cumsum()
_result = (r[start:end] for start, end in zip(counts, counts[1:]))
return dict(zip(categories, _result))
_result = (r[start:end] for start, end in zip(counts, counts[1:], strict=False))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use itertools.pairwise here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Could you re-review?

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Oct 6, 2025
@mroeschke mroeschke added this to the 3.0 milestone Oct 7, 2025
@mroeschke mroeschke merged commit 7263a95 into pandas-dev:main Oct 7, 2025
42 checks passed
@mroeschke
Copy link
Member

Thanks @GuruprashanthKrishnakumar

jzwick pushed a commit to jzwick/pandas that referenced this pull request Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants