-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Grouper using frequency has inconsistent behavior inside and outside a list #16746
Comments
You would have to show a complete example. How is it different from this. (which is on master).
|
This data reproduces the bug, when using timestamp as the index of the dataframe (sorry to give you the data in the body of a comment, but I'm behind a coorporate proxy, and don't have access to upload platforms like pastebin):
|
Using the data sample above as >>> df = pd.read_csv('sample.csv', parse_dates=['timestamp'], index_col='timestamp')
>>> df.groupby(pd.Grouper(freq='H')).agg({'value': 'mean'})
value
timestamp
2016-06-07 00:00:00 2.729111e+11
2016-06-07 01:00:00 NaN
2016-06-07 02:00:00 NaN
2016-06-07 03:00:00 NaN
2016-06-07 04:00:00 NaN
...
>>> df.groupby([pd.Grouper(freq='H')]).agg({'value': 'mean'})
value
timestamp
2016-06-07 2.729111e+11
2016-07-07 2.509444e+11
2016-07-13 2.775778e+11
2016-07-15 2.490556e+11
2016-07-16 2.676190e+11
... |
ok, your example repros. If you can step thru both the working and non-working cases (as well as |
closing as duplicate of #17530 |
Code Sample
Problem description
This is an inconsistent behavior, and there is no mention to this on groupby or Grouper documentation.
Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: