Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
groupby.mean, etc, doesn't recognize timedelta64 #5724
Comments
|
Worth mentioning that DataFrame's mean doesn't do this either, I think it should (convert those originally datelike to date):
Compare to |
|
Interestingly,
|
|
@hayd actually the results of
so @hayd maybe create a separate issue for this type of inference (Its just a bit of inference detection in nanops.py/_reduce) |
|
@hsharrison as far as the groupby; this is just not implemented ATM in groupby.py; its not that difficult, just needs to follow basically what datetime64 stuff does |
jreback
modified the milestone: 0.15.0, 0.14.0
Feb 18, 2014
|
See #6884. |
danielballan
referenced
this issue
Apr 16, 2014
Closed
ENH: Allow aggregate numeric operations on timedelta64. #6884
jreback
modified the milestone: 0.14.0, 0.15.0
Apr 16, 2014
jreback
modified the milestone: 0.14.1, 0.14.0
May 5, 2014
jreback
modified the milestone: 0.15.0, 0.14.1, 0.15.1
Jul 1, 2014
jreback
modified the milestone: 0.15.1, 0.15.0
Sep 9, 2014
jreback
modified the milestone: 0.16.0, Next Major Release
Mar 6, 2015
jreback
added Difficulty Intermediate Effort Medium
labels
Apr 8, 2015
tomfitzhenry
commented
Oct 15, 2015
|
Workaround: Use See https://gist.github.com/tomfitzhenry/d36ebba697a1f3eeefcb for demo. |
|
Wow. Any insight into why that works? I would not have expected a convenience method to take a different code path. |
zaxliu
commented
Nov 3, 2015
|
Also has the same problem. @tomfitzhenry 's solution works. |
kjam
commented
Feb 3, 2016
|
Seeing as this keeps getting kicked to the next release, you can also perform
|
jreback
referenced
this issue
Feb 24, 2016
Closed
calling mean on groupby of timedelta does not work #12440
jreback
modified the milestone: 0.18.1, Next Major Release
Feb 24, 2016
jreback
modified the milestone: 0.18.1, 0.18.2
Apr 25, 2016
jreback
modified the milestone: 0.18.2, 0.19.0
Jul 6, 2016
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jan 4, 2017
|
|
jreback |
be7d2d2
|
jreback
referenced
this issue
Jan 4, 2017
Closed
BUG: make sure that we are passing thru kwargs to groupby #15054
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jan 5, 2017
|
|
jreback |
045bcb5
|
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jan 9, 2017
|
|
jreback |
75fc113
|
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jan 10, 2017
|
|
jreback |
f64a309
|
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jan 11, 2017
|
|
jreback |
c250302
|
jreback
added a commit
to jreback/pandas
that referenced
this issue
Jan 11, 2017
|
|
jreback |
768fce1
|
jreback
closed this
in 8e13da2
Jan 18, 2017
AnkurDedania
added a commit
to AnkurDedania/pandas
that referenced
this issue
Mar 21, 2017
|
|
jreback + AnkurDedania |
d8d866f
|
hsharrison commentedDec 17, 2013
See http://stackoverflow.com/questions/20625982/split-apply-combine-on-pandas-timedelta-column
related as well: http://stackoverflow.com/questions/20789976/python-pandas-dataframe-1st-line-issue-with-datetime-timedelta/20802902#20802902
I have a DataFrame with a column of timedeltas (actually upon inspection the dtype is
timedelta64[ns]or'<m8[ns]'), and I'd like to do a split-combine-apply, but the timedelta column is being dropped:Or, forcing pandas to try the operation on the 'td' column:
However, taking the mean of the column works fine, so numeric operations should be possible: