We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
>>> df = pd.DataFrame(np.random.randint(0, 100, (50, 2)), columns=['jim', 'joe']) >>> ts = pd.Series(np.random.randint(0, 3, 50)) >>> df.groupby(ts, as_index=False).idxmax() jim joe 0 25 36 1 22 5 2 3 4 >>> df.groupby(ts, as_index=False).max() NaN jim joe 0 0 93 94 1 1 94 89 2 2 85 93
max adds the grouper to the result frame, whereas idxmax doesn't.
max
idxmax
The API documentation says:
as_index=False is effectively “SQL-style” grouped output
so i would assume, it should not inject a new column with NaN name.
NaN
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
max
adds the grouper to the result frame, whereasidxmax
doesn't.The API documentation says:
so i would assume, it should not inject a new column with
NaN
name.The text was updated successfully, but these errors were encountered: