home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1176730713

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/6758#issuecomment-1176730713 https://api.github.com/repos/pydata/xarray/issues/6758 1176730713 IC_kwDOAMm_X85GI3xZ 2448579 2022-07-06T20:54:23Z 2022-07-06T20:54:23Z MEMBER

Yes that's right.

For this simple problem you could combine np.digitize and np.bincount to do it much quicker.

python group_idx = np.digitize(latitude, bins) sums = np.bincount(group_idx, weights=array)

And then wrap this using apply_ufunc. See https://github.com/ml31415/numpy-groupies/blob/412be938dcdfd74c6d673dd29012d18dc25dc94f/numpy_groupies/aggregate_numpy.py#L8-L28 for inspiration.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1295939038
Powered by Datasette · Queries took 1.742ms · About: xarray-datasette