Skip to content

ERR: all nan grouping provides unfriendly error message #15036

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
jreback opened this issue Jan 2, 2017 · 4 comments · Fixed by #41493
Closed

ERR: all nan grouping provides unfriendly error message #15036

jreback opened this issue Jan 2, 2017 · 4 comments · Fixed by #41493
Labels
good first issue Needs Tests Unit test(s) needed to prevent regressions
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Jan 2, 2017

https://github.com/pandas-dev/pandas/pull/14649/files#r94330188

This seems unfriendly, should instead b a DataError

In [8]: s = Series([1,2,3],[np.nan,np.nan,np.nan])

In [9]: s.groupby(s.index).sum()
TypeError: unhashable type: 'Float64Index'
@jreback jreback added Difficulty Intermediate Error Reporting Incorrect or improved errors from pandas Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Jan 2, 2017
@jreback jreback added this to the Next Major Release milestone Jan 2, 2017
@Shekharrajak
Copy link

@jreback , what should be the output? I want to work on it.

@jreback
Copy link
Contributor Author

jreback commented Jan 15, 2017

actually on second thought this should just be s grouper that is empty (we skip all nan groups);
so if u fix the grouping it should just work

@Shekharrajak
Copy link

Thanks @jreback , I am trying.

@mroeschke
Copy link
Member

I think this returns a reasonable output now (all groups are dropped). Could use a test

In [43]: s.groupby(s.index).sum()
Out[43]: Series([], dtype: int64)

In [44]: pd.__version__
Out[44]: '1.3.0.dev0+1485.g6abb567cb1'

@mroeschke mroeschke added good first issue Needs Tests Unit test(s) needed to prevent regressions and removed Error Reporting Incorrect or improved errors from pandas Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels May 2, 2021
@mroeschke mroeschke modified the milestones: Contributions Welcome, 1.3 May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Needs Tests Unit test(s) needed to prevent regressions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants