Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Series|Expr.cum_prod method, add reverse kw in cum_sum method #1386

Merged
merged 2 commits into from
Nov 16, 2024

Conversation

FBruzzesi
Copy link
Member

What type of PR is this? (check all applicable)

  • 💾 Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 🔧 Optimization
  • 📝 Documentation
  • ✅ Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

This is 3 folded (I could not resist)

  • Introduce cum_prod
  • Adds reverse in cum_sum
  • Adds cumulative methods for dask if reverse=False, raise otherwise

@github-actions github-actions bot added the enhancement New feature or request label Nov 16, 2024
Comment on lines -819 to -823
return (
not_na_series.cum_sum()
if not reverse
else len(self) - not_na_series.cum_sum() + not_na_series - 1
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Ok maybe this could be faster as it does not reverse the array twice

Comment on lines +2703 to +2705
Returns:
A new expression.

Copy link
Member Author

Choose a reason for hiding this comment

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

Guess who forgot about these returns

Copy link
Member

Choose a reason for hiding this comment

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

😆 #1387 will enforce them

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks @FBruzzesi !

@MarcoGorelli MarcoGorelli merged commit 251444c into main Nov 16, 2024
22 checks passed
@FBruzzesi FBruzzesi deleted the feat/cum-prod branch November 16, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants