Skip to content

Length/size of datetime groups cast as datetimes #15246

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
nbonnotte opened this issue Jan 27, 2017 · 1 comment
Closed

Length/size of datetime groups cast as datetimes #15246

nbonnotte opened this issue Jan 27, 2017 · 1 comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Duplicate Report Duplicate issue or pull request Groupby

Comments

@nbonnotte
Copy link
Contributor

In [7]: pandas.Series([datetime.datetime.utcnow()]*4).groupby([1, 1, 2, 2]).agg('size')
Out[7]: 
1    2
2    2
dtype: int64

In [8]: pandas.Series([datetime.datetime.utcnow()]*4).groupby([1, 1, 2, 2]).agg(len)
Out[8]: 
1   1970-01-01 00:00:00.000000002
2   1970-01-01 00:00:00.000000002
dtype: datetime64[ns]

In [9]: pandas.Series([datetime.datetime.utcnow()]*4).groupby([1, 1, 2, 2]).agg(numpy.size)
Out[9]: 
1   1970-01-01 00:00:00.000000002
2   1970-01-01 00:00:00.000000002
dtype: datetime64[ns]

Output of pd.show_versions()

commit: 3853fe6 python: 2.7.11.final.0 python-bits: 64 OS: Linux OS-release: 4.4.0-59-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: None.None

pandas: 0.19.0+395.g3853fe6
nose: 1.3.7
pip: 8.1.2
setuptools: 22.0.0
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.1
statsmodels: None
xarray: None
IPython: 4.2.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
pandas_datareader: None

@jreback
Copy link
Contributor

jreback commented Jan 27, 2017

this is a dupe: #10972

welcome to have a pr to fix.

@jreback jreback closed this as completed Jan 27, 2017
@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Duplicate Report Duplicate issue or pull request Groupby labels Jan 27, 2017
@jreback jreback added this to the No action milestone Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Duplicate Report Duplicate issue or pull request Groupby
Projects
None yet
Development

No branches or pull requests

2 participants