-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: various groupby ewm times issues #40952
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
e7a9d31
8e3ed3b
b3e7e99
b7f38e3
e1ecb58
c5e80d1
91f7390
f2dc759
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 |
---|---|---|
|
@@ -85,6 +85,7 @@ def generate_numba_groupby_ewma_func( | |
com: float, | ||
adjust: bool, | ||
ignore_na: bool, | ||
deltas: np.ndarray, | ||
): | ||
""" | ||
Generate a numba jitted groupby ewma function specified by values | ||
|
@@ -97,6 +98,7 @@ def generate_numba_groupby_ewma_func( | |
com : float | ||
adjust : bool | ||
ignore_na : bool | ||
deltas : numpy.ndarray | ||
Returns | ||
------- | ||
|
@@ -141,7 +143,9 @@ def groupby_ewma( | |
|
||
if is_observation or not ignore_na: | ||
|
||
old_wt *= old_wt_factor | ||
# note that len(deltas) = len(vals) - 1 and deltas[i] is to be | ||
# used in conjunction with vals[i+1] | ||
old_wt *= old_wt_factor ** deltas[start + j - 1] | ||
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. why -1? 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. We want to use I could introduce a new variable 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. no its fine, if you'd just add some documentation to this effect for future readers |
||
if is_observation: | ||
|
||
# avoid numerical errors on constant series | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this not
s:e
? (like sub_vals)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deltas are the (scaled) np.diff of the times vector. so
len(deltas) = len(times) - 1 = len(vals) - 1
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk can you add this comment on the shape of sub_vals vs sub_deltas for future readers