-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
ENH: Add engine keyword to expanding.apply to utilize Numba #30937
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
Changes from all commits
ad5e12e
4e7b566
36bbead
970778b
6442f15
42b6064
02e6724
cb7bf1c
7ab9229
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from textwrap import dedent | ||
from typing import Dict, Optional | ||
|
||
from pandas.compat.numpy import function as nv | ||
from pandas.util._decorators import Appender, Substitution | ||
|
@@ -148,8 +149,23 @@ def count(self, **kwargs): | |
|
||
@Substitution(name="expanding") | ||
@Appender(_shared_docs["apply"]) | ||
def apply(self, func, raw=False, args=(), kwargs={}): | ||
return super().apply(func, raw=raw, args=args, kwargs=kwargs) | ||
def apply( | ||
self, | ||
func, | ||
raw: bool = False, | ||
engine: str = "cython", | ||
engine_kwargs: Optional[Dict[str, bool]] = None, | ||
args=None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this totally equivalent? I get the impression previously should have been *args and **kwargs so a little strange as is, but I don't think converting to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously the docs described But in actuality, the arguments were Since the docs were incorrect, and the prior arguments has a mutable default argument, I changed So slightly changing the behavior, but taking advantage of the fact the docs were incorrect in the first place. |
||
kwargs=None, | ||
): | ||
return super().apply( | ||
func, | ||
raw=raw, | ||
engine=engine, | ||
engine_kwargs=engine_kwargs, | ||
args=args, | ||
kwargs=kwargs, | ||
) | ||
|
||
@Substitution(name="expanding") | ||
@Appender(_shared_docs["sum"]) | ||
|
Uh oh!
There was an error while loading. Please reload this page.