Groupby exclude dimension
See original GitHub issueIs there some way to do a groupby operation where some dimension is excluded from the operation, e.g., a vectorized version of something like this:
vertlevels = [ds.vel.sel(nVertLevels=i).groupby('y').mean() for i in ds.nVertLevels]
xavgvel = xr.concat(vertlevels, 'nVertLevels')
The application here is to average 3D data in the x coordinate to the unique y coordinates, but not the vertical coordinate.
Thus, we are basically looking for something that allows a coordinate to be excluded from the groupby operation, e.g., in this case the vertical coordinate. Ideally this would also be possible within the context of the groupby_bins
operation.
Any ideas on how this should work or a pointer on how to implement this type of operation more cleanly with existing infrastructure is greatly appreciated. This appears to be related to #324 and especially (perhaps identically) #924.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How to exclude more than one group in a groupby using ...
I know in order to exclude one group from a groupby you can use the following code: grouped = df. groupby(['Region']) df1 =...
Read more >Group by: split-apply-combine — pandas 1.5.2 documentation
GroupBy dropna By default NA values are excluded from group keys during the groupby operation. However, in case you want to include NA...
Read more >Group Your Data - Tableau Help
To remove members from an existing group: In the Data pane, right-click the group field, and then click Edit Group. In the Edit...
Read more >Pandas GroupBy - GeeksforGeeks
Splitting : It is a process in which we split data into group by applying ... that is indexed the same (same size)...
Read more >Monitoring Query Language (MQL) Reference
Filter out (exclude) dimension values in an MQL expression. ... For example, groupBy(availabilityDomain) groups results by availability ...
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
Thanks for making everyone’s life so much better via xarray and for helping us all to contribute to this process @shoyer!
My guess is that this could be implemented pretty quickly on top of #924, which is currently on hold while I finish up #964.