Skip to content

Aggregated datetime64 column converted to float #2238

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

Closed
mattijohn opened this issue Nov 13, 2012 · 3 comments
Closed

Aggregated datetime64 column converted to float #2238

mattijohn opened this issue Nov 13, 2012 · 3 comments
Milestone

Comments

@mattijohn
Copy link

See this Stackoverflow question

It appears that when grouping and then aggregating a datetime column the dtype converts to float

@lodagro
Copy link
Contributor

lodagro commented Nov 13, 2012

this is what i get with master:

In [79]: dt
Out[79]: 
                           atn  file
datetime                            
2012-10-08 14:00:00  23.007462     1
2012-10-08 14:30:00  27.045666     1
2012-10-08 15:00:00  31.483825     1
2012-10-08 15:30:00  37.540651     2
2012-10-08 16:00:00  43.564573     2
2012-10-08 16:00:00  48.589852     2
2012-10-08 16:00:00  55.289452     2

In [80]: dt.reset_index().groupby(by="file").aggregate("first")
Out[80]: 
                datetime        atn
file                               
1    2012-10-08 14:00:00  23.007462
2    2012-10-08 15:30:00  37.540651

In [81]: dt.reset_index().groupby(by="file").aggregate("first").dtypes
Out[81]: 
datetime    datetime64[ns]
atn                float64

@wesm
Copy link
Member

wesm commented Nov 14, 2012

This was fixed in #2133

@wesm wesm closed this as completed Nov 14, 2012
@mattijohn
Copy link
Author

Thanks, sorry didn't notice it when I searched the issues list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants