pd.Grouper support?
See original GitHub issueIn pandas, you can pas a pandas.TimeGrouper
object to a .groupby()
call, and it allows you to group by month, year, day, or other times, without manually creating a new index with those values first. It would be great if you could do this with xray
, but at the moment, I get:
/usr/local/lib/python3.4/dist-packages/xray/core/groupby.py in __init__(self, obj, group, squeeze)
66 if the dimension is squeezed out.
67 """
---> 68 if group.ndim != 1:
69 # TODO: remove this limitation?
70 raise ValueError('`group` must be 1 dimensional')
AttributeError: 'TimeGrouper' object has no attribute 'ndim'
Not sure how this will work though, because pandas.TimeGrouper doesn’t appear to work with multi-index dataframes yet anyway, so maybe there needs to be a feature request over there too, or maybe it’s better to implement something from scratch…
Issue Analytics
- State:
- Created 9 years ago
- Comments:24 (11 by maintainers)
Top Results From Across the Web
pandas.Grouper — pandas 1.5.2 documentation
A Grouper allows the user to specify a groupby instruction for an object. This specification will select a column via the key parameter,...
Read more >support pd.Grouper in dd.DataFrame.groupby #1749 - GitHub
In pandas we can group using a time-based grouper and other columns. ... dask support this. pandas docs are here agg_cmg2 = df2.groupby([pd....
Read more >Pandas Grouper and Agg Functions Explained
Explanation of panda's grouper and aggregation (agg) functions. ... import pandas as pd df = pd.read_excel("https://github.com/chris1610/ ...
Read more >Pandas Grouper - Why can't it handle numerical columns in ...
pd.Grouper only supports binning of time objects like datetimes, periods or timedeltas. For other types, pd.Grouper will group by unique values.
Read more >Using pandas.Grouper for multiple columns in MultiIndex
Grouper to groupby two different values in a MultiIndex and I can't seem to figure it out. Consider this example: import pandas as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, the functionality is still there, it’s just recommended that you use pd.Grouper. On Wed, Nov 29, 2017 at 2:47 AM lexual notifications@github.com wrote:
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity
If this issue remains relevant, please comment here or remove the
stale
label; otherwise it will be marked as closed automatically