-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
"SpecificationError: nested dictionary is ambiguous in aggregation" in a certain case of groupby-aggregation #25471
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
Not sure, probably a bug. If you're interested in debugging further, let us know. |
I can confirm in pandas 0.25.0. These work fine:
But this raises an error:
And the
|
df.groupby('A')['B'].agg({'B':['sum','count']}) Here, the column 'B' is returned as a series so aggregation is not possible. |
Looks to work on master now. Could use a test
|
We are a university team looking for a good first issue. |
Take |
All of these examples for using
agg
work fine:This one throws a future warning as mentioned here:
This one works just fine:
But this one throws an error (I'm aware this expression isn't necessary):
Why does it throw this error?
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.8.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 79 Stepping 1, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en
LOCALE: None.None
pandas: 0.24.1
pytest: 3.9.1
pip: 19.0.1
setuptools: 40.8.0
Cython: 0.29.5
numpy: 1.15.4
scipy: 1.2.0
pyarrow: None
xarray: None
IPython: 7.2.0
sphinx: 1.8.4
patsy: 0.5.1
dateutil: 2.7.5
pytz: 2018.9
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 3.0.2
openpyxl: 2.6.0
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.1.2
lxml.etree: 4.3.1
bs4: 4.7.1
html5lib: 1.0.1
sqlalchemy: 1.2.18
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: 0.2.1
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: