home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 149130368

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
149130368 MDU6SXNzdWUxNDkxMzAzNjg= 830 "Reverse" groupby method for split/apply/combine 5629061 closed 0     5 2016-04-18T12:00:04Z 2020-10-04T16:06:58Z 2020-10-04T16:06:58Z NONE      

When dealing with high-dimensional data, algorithms often involve operations or aggregation on a particular dimension only, whilst keeping all other dimensions in the dataset.

For example, I might know that I want to average all data along the time axis, and I'm indifferent to the other dimensions present, i.e. I want my algorithm to work whenever there is a time axis, and to be indifferent to the presence/lack of any other dimensions.

Mapping this kind of implementation to xarray is awkward though because I can only use groupby() for the split/apply/combine operation.

For example, in xarray I have to do this:

averages = dataarray.groupby([dimensions excluding time dimension]).apply(my_method_that_works_on_time_dimension)

instead of this (where aggregate_over() is my "reverse" groupby method):

averages = dataarray.aggregate_over([time_dimension]).apply(my_method_that_works_on_time_dimension)

For the first example I have to do some extra work: I have to write additional code to fetch all the dimensions in the array, remove the time dimension from that list, and then use that list with groupby, in order to make my code depend on the time dimension only.

It would be really helpful to add a aggregate_over() method (name TBD of course!) as an alternative to groupby() that automates this extra work.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/830/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.641ms · About: xarray-datasette