issue_comments
2 rows where issue = 224878728 and user = 244887 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- argmin / argmax behavior doesn't match documentation · 2 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
363072151 | https://github.com/pydata/xarray/issues/1388#issuecomment-363072151 | https://api.github.com/repos/pydata/xarray/issues/1388 | MDEyOklzc3VlQ29tbWVudDM2MzA3MjE1MQ== | gajomi 244887 | 2018-02-05T12:35:10Z | 2018-02-05T12:35:10Z | CONTRIBUTOR | @fujiisoup and @shoyer Really enlightening comments above. I think I am starting to get the dao of xarray a bit better :)
Agreed it would be nice to have a consistent and well reasoned rule for coordinate propagation in aggregation methods. I think a key point here, which gets brought up in your example is that it might make sense to have different subrules depending on the semantics of the operation. Functions like
Yeah, I felt a little dirty appending '_argmax'.
OK. I think I understand now why @fujiisoup proposed output a Dataset rather than an array. That's a natural syntax for getting the values from the indices.
+1 to dedicated adding more methods if needed, since I think even if it isn;t needed the associated docs will need to make sure users are aware of the analogous |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
argmin / argmax behavior doesn't match documentation 224878728 | |
362717912 | https://github.com/pydata/xarray/issues/1388#issuecomment-362717912 | https://api.github.com/repos/pydata/xarray/issues/1388 | MDEyOklzc3VlQ29tbWVudDM2MjcxNzkxMg== | gajomi 244887 | 2018-02-02T21:50:05Z | 2018-02-02T21:50:05Z | CONTRIBUTOR | I just came across the various argmax/idxmax (and related min) related issues recently in a project I have been working on. In addition to agreeing that docs should be updated when appropriate here are my two or three cents:
Coordinates: * w (w) <U3 'w_0' 'w_1' * x (x) <U3 'x_0' 'x_1' * y (y) <U3 'y_0' 'y_1' * z (z) <U3 'z_0' 'z_1' ``` I would like to get something like the following ```python
Coordinates:
* x (x) object 'x_0' 'x_1'
* z (z) object 'z_0' 'z_1'
* argmaxdim (argmaxdim) <U1 'w' 'y'
def argmax(da, dim=None): daname = "" if da.name is None else da.name name = daname+"_argmax" if dim is None: maxda = da.where(da == da.max(),drop=True) dims = list(maxda.dims) dimmaxvals = [maxda.coords[dim].values[0] for dim in dims] result = xr.DataArray(dimmaxvals, dims='argmaxdim', coords={'argmaxdim':dims}, name = name) return result else: if isinstance(dim,str): dim = [dim] keepdims = [d for d in da.dims if d not in dim] dastacked = da.stack(keepdims = keepdims) slices = [_argmaxstackeddim(dastacked,i) for i in range(len(dastacked.keepdims))] return xr.merge(slices)[name] ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
argmin / argmax behavior doesn't match documentation 224878728 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [issue] INTEGER REFERENCES [issues]([id]) ); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 1