-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: .shift optionally takes multiple periods #54115
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
4e1a84e
db9cd03
9def045
b7ea297
299927a
6cf632e
23d9142
b78d7d6
cabd28c
5017721
6f3ec9b
8d085f3
6e66a19
f7ea7a3
f8e29d9
e54ba33
715c397
21e8e70
0e78963
2c602e2
d9bf54f
778b7e9
ad49861
28469db
c8e5bad
cb4013d
226fa6f
cb49cac
44b0866
5257292
eff4ed2
04d4513
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 |
---|---|---|
|
@@ -3028,7 +3028,7 @@ def autocorr(self, lag: int = 1) -> float: | |
>>> s.autocorr() | ||
nan | ||
""" | ||
return self.corr(self.shift(lag)) | ||
return self.corr(cast(Series, self.shift(lag))) | ||
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. This is necessary because Series.shift can now return a dataframe if there are multiple periods. Mypy complains at this line because it wants Series and not 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. You could add type-overloads to handle this. Sometimes they can get gnarly (see e.g. concat), but I think this one should be relatively straight forward. 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. I'd prefer not to if that's ok? There is no 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. If you insist I will try! 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. Otherwise I think this is done? 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. Hi @rhshadrach , do you have time for another round/sign this off? 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. I'm okay with opening an issue regarding this once it's merged for someone to followup on. |
||
|
||
def dot(self, other: AnyArrayLike) -> Series | np.ndarray: | ||
""" | ||
|
Uh oh!
There was an error while loading. Please reload this page.