GroupBy handles non-numeric data differently for different aggregation functions #20871
Labels
Dtype Conversions
Unexpected or buggy dtype conversions
Duplicate Report
Duplicate issue or pull request
Groupby
Code Sample, a copy-pastable example if possible
Problem description
GroupBy
objects behave differently for different aggregation functions when used on non-numeric data types.mean
(amongst others) re-raises onGroupByError
whilesum
(amongst others) falls back onnp.sum
.The expected behavior would be that all such functions either fall back on their
numpy
equivalent or re-raise onDataError
for non-numeric data.Expected Output
All such functions should either fall back on their
numpy
equivalent or re-raise onDataError
for non-numeric data.Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-119-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.22.0
pytest: None
pip: 9.0.1
setuptools: 34.2.0
Cython: None
numpy: 1.14.0
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: 5.2.2
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.0.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: 0.7.3
lxml: None
bs4: 4.4.1
html5lib: 0.9999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.5
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: