-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: apply idxmax on one-column DataFrameGroupby generates ValueError #5788
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
These seem to work on current master....
|
@jorisvandenbossche I put your test about in for #5790, but seems to work ok for me (after I had merged the |
actually this DOES show up, but only on py 2.6 (which also uses an older numpy) |
alright....resolved for numpy < 1.7 (in #5790). Very odd error, you apparently can't vstack M8[ns] dtypes and have them stay the same dtype, another oddity of numpy. |
Yes, indeed, the problem was numpy 1.6.2! With 1.7.1 it works. |
Hi @jreback , I encountered some strange behavior (in #31063 ) which is seemingly caused by the unstack here (https://github.com/pandas-dev/pandas/pull/5790/files#diff-720d374f1a709d0075a1f0a02445cd65R2256) I am not sure whether this behavior is by design? |
you are commenting in 6 year old code |
With this dataframe:
applying an
idxmax
:produces on master:
while this does work on 0.12
It has to do I think with difference between SeriesGroupby and DataFrameGroupby with one column, as
df.groupby(df.index.date)['value'].apply(lambda x: x.idxmax())
does work in master, but in 0.12 both ways work.The text was updated successfully, but these errors were encountered: