-
Notifications
You must be signed in to change notification settings - Fork 993
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
shift() behaviour with missing periods #1530
Comments
|
what's wrong with the self-join? |
or join with full sequence of dates expanding your dataset, if needed do roll join so last known values is provided for the gaps |
If the user is aware that they need to do it, there certainly are many ways to achieve the desired output, with My impression was that Looking back at e.g. SO1 and SO2, rolling had to be explicitly set to TRUE if needed. @franknarf1 I agree that trying to include logic to infer the user's intent in |
@pstoyanov that's a fair point on the documentation. |
I'm actually not sure it's nontrivial to get at what you have in mind. actually this seems like a pretty good suggestion. |
Hi,
I am not sure whether to formulate this as a question, a suggestion for warning in the docs or a feature request...
The way in which
shift()
currently works (with irregular intervals) is like this:My issue is the lagged value for time == 4. I'd expect behaviour like this if I specify rolling explicitly, but not in lagging. The documentation for
shift
specifically refers to the n argument as "...periods to lead/lag by..", and with n = 1 the value maybe should not silently be lagged 2 periods.lag {stats}
also specifies their argument k as "The number of lags (in units of observations)"What the user (if they tend to think like me, that is) probably meant was:
or even
I understand this is an issue only for ordered, regular, time-like cases but still maybe worth mentioning in the documentation, or adding a warning?
Or modifying the
fill =
argument (which currently is more likepad_by =
) to provide the suggested behaviour above?Thanks!
The text was updated successfully, but these errors were encountered: