-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: cython version of groupby.cummax throws error on datetimes #15561
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
Comments
I think this may be as easy as adding a Line 1454 in 04e1168
|
This is correct and not a bug. datetimes are not numeric types. This has to be specifically enabled.
|
@jreback - maybe the API is set, but isn't this inconsistent? In [23]: df = pd.DataFrame(dict(a=[1], b=pd.to_datetime(['2001'])))
In [24]: df['b'].max()
Out[24]: Timestamp('2001-01-01 00:00:00')
In [25]: df['b'].cummax()
Out[25]:
0 2001-01-01
Name: b, dtype: datetime64[ns]
In [26]: df.groupby('a')['b'].max()
Out[26]:
a
1 2001-01-01
Name: b, dtype: datetime64[ns]
In [27]: df.groupby('a')['b'].cummax()
Out[27]:
DataError: No numeric types to aggregate |
@chris-b1 hmm, ahh we are defaulting yes that should be done for |
Code Sample, a copy-pastable example if possible
Problem description
The current github version of pandas has cython implementations of
groupby.cummin
andgroupby.cummax
, which throw an error if called on datetime columns. (See #15048, 0fe491d.)Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.9.8-100.fc24.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: C
LANG: C
LOCALE: None.None
pandas: 0.19.0+531.g04e1168
pytest: 3.0.5
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.11.3
scipy: 0.18.1
xarray: 0.9.1
IPython: 4.2.0
sphinx: 1.5.1
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.2
feather: None
matplotlib: 2.0.0
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 3.7.2
bs4: 4.5.3
html5lib: 0.999
sqlalchemy: 1.1.5
pymysql: None
psycopg2: None
jinja2: 2.9.4
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: