Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Time-based .rolling() fails with .groupby() #13966
Comments
|
Agree that this should work! |
jorisvandenbossche
added Bug Groupby Reshaping
labels
Aug 11, 2016
chrisaycock
referenced
this issue
Aug 16, 2016
Open
Rolling groupby should not maintain the by column in the resulting DataFrame #14013
hueykwik
commented
Nov 26, 2016
|
Is there a good workaround? |
semio
added a commit
to semio/ddf_utils
that referenced
this issue
Dec 13, 2016
|
|
semio |
3b14540
|
ShashankBharadwaj
commented
Dec 20, 2016
|
Is the any way to do time aware rolling with group by for now before the new pandas release? |
|
@ShashankBharadwaj this is not fixed, so new release or not is not going to matter. |
jreback
added this to the
Next Major Release
milestone
Dec 20, 2016
jreback
added Difficulty Intermediate Effort Low
labels
Dec 20, 2016
zscholl
commented
Apr 20, 2017
•
|
I stumbled on this yesterday as I was trying to solve the same problem. I found a workaround, it's definitely not efficient, but it works.
Hope this helps anyone in the meantime before a bug fix is provided. I haven't contributed to pandas yet, but having used it so much, maybe it's about time :) |
|
@zscholl Thanks for your workaround. A bug fixes would be great if you're offering. |
zscholl
commented
Apr 20, 2017
|
I'll take a look at it in the coming weeks, @chrisaycock and see what I can do! |
|
so this actually works on master now. fixed by #15694 (this will make sure that when sorting a multi-index it actually IS sorting it, previously it would not guarantee monotonic levels, only lexsortedness). so this just needs tests
|
jreback
added a commit
to jreback/pandas
that referenced
this issue
Apr 22, 2017
|
|
jreback |
e28d07e
|
jreback
modified the milestone: 0.20.0, Next Major Release
Apr 22, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Apr 22, 2017
|
|
jreback |
b30a50f
|
jreback
closed this
in #16091
Apr 22, 2017
jreback
added a commit
that referenced
this issue
Apr 22, 2017
|
|
jreback |
f0bd908
|
linebp
added a commit
to linebp/pandas
that referenced
this issue
May 2, 2017
|
|
jreback + linebp |
09f9e10
|
pcluo
added a commit
to pcluo/pandas
that referenced
this issue
May 22, 2017
|
|
jreback + pcluo |
a66a612
|
chrisaycock commentedAug 11, 2016
•
edited
Starting with this example:
I can easily compute the rolling mean by identifier:
Now I want to add a timestamp column:
The timestamps are ordered within each identifier, but pandas complains:
Re-sorting leads to a different error:
But we know that these column names are valid:
It seems like a bug that time-based
.rolling()does not work with.groupby().