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
need a systematic test of all groupby methods here.
This works as expected:
pd.DataFrame({'time': [pd.Timestamp('2012-01-01 13:00:00+00:00')], 'A': [3]}).groupby('A', as_index=False).head(1)
However, this loses the timezone:
pd.DataFrame({'time': [pd.Timestamp('2012-01-01 13:00:00+00:00')], 'A': [3]}).groupby('A', as_index=False).first()
The text was updated successfully, but these errors were encountered:
so this falls down: https://github.com/pandas-dev/pandas/blob/master/pandas/core/groupby.py#L1929
essentially .values is a DatetimeIndex at this point, not a numpy array. (because its passed block.values higher up). So this needs to be handled.
.values
block.values
Sorry, something went wrong.
I believe the solution to this issue xrefs to #19026 (here), where np.asarray will convert the datetimetz dtype to just a datetime dtype.
np.asarray
Successfully merging a pull request may close this issue.
need a systematic test of all groupby methods here.
This works as expected:
However, this loses the timezone:
The text was updated successfully, but these errors were encountered: