home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 298256260

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/1388#issuecomment-298256260 https://api.github.com/repos/pydata/xarray/issues/1388 298256260 MDEyOklzc3VlQ29tbWVudDI5ODI1NjI2MA== 1217238 2017-04-30T20:50:49Z 2017-04-30T20:50:49Z MEMBER

I agree that arr[arr.argmin(dim)] == arr.min(dim) is a useful invariant, but currently xarray's indexing works a little differently from NumPy. Probably arr.isel_points(**arr.argmin(dim)) == arg.min(dim) is the better invariant for now, and in the future arr[arr.argmin(dim)] will change to work consistently (#974).

The main downside of returning a tuple or dict from argmin() is that it makes the common case of taking the max/min over one dimension a little harder. So possibly it would be better to write two methods:

  • argmin would work like it does currently (returning an xarray object), but error if reducing over multiple dimensions.
  • argmin_indices would return a dict suitable for use in indexing.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  224878728
Powered by Datasette · Queries took 1.864ms · About: xarray-datasette