home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where author_association = "MEMBER" and issue = 239918314 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • fujiisoup 3
  • shoyer 2

issue 1

  • Argmin indexes · 5 ✖

author_association 1

  • MEMBER · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
609103467 https://github.com/pydata/xarray/pull/1469#issuecomment-609103467 https://api.github.com/repos/pydata/xarray/issues/1469 MDEyOklzc3VlQ29tbWVudDYwOTEwMzQ2Nw== fujiisoup 6815844 2020-04-04T23:24:20Z 2020-04-04T23:24:20Z MEMBER

Hi @johnomotani . Probably I have no time to finish this up and this is already too old. It would be nice if someone can update this PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Argmin indexes 239918314
313061867 https://github.com/pydata/xarray/pull/1469#issuecomment-313061867 https://api.github.com/repos/pydata/xarray/issues/1469 MDEyOklzc3VlQ29tbWVudDMxMzA2MTg2Nw== fujiisoup 6815844 2017-07-05T10:13:18Z 2017-07-05T10:13:18Z MEMBER

@shoyer Sorry. My example was still not good (I modified the previous example slightly).

I think my current implementation does not work even for (the future version of) .sel, because the resultant xr.Dataset has the index for 'y' and labels for 'x'.

As you suggested, it looks more xarray-like if it returns coordinates for both 'x' and 'y', python <xarray.Dataset> Dimensions: (x: 3) Coordinates: * x (x) <U1 'c' 'b' 'a' Data variables: y (x) float64 1.4 4.3 1.4 so that it can be passed to .sel.

This API looks much more natural to me than the current one, although it has to wait for #974. I will update this PR.

For the function name. Based on your suggestion, how about labels_min or argmin_labels? I think function names of idxmin and (the current) indexes_min can be too different because idxmin should return 'index' while indexes_min returns label.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Argmin indexes 239918314
312908355 https://github.com/pydata/xarray/pull/1469#issuecomment-312908355 https://api.github.com/repos/pydata/xarray/issues/1469 MDEyOklzc3VlQ29tbWVudDMxMjkwODM1NQ== fujiisoup 6815844 2017-07-04T15:46:20Z 2017-07-05T10:06:53Z MEMBER

@shoyer Thanks for the comments.

  • APIs
    Sounds reasonable suggestions. I renamed argmin_indexs -> indexes_min. Also I added idxmin that works as similar to pandas's idxmin. The APIs are
    python def indexes_min(self, dims=None, skipna=True): and python def idxmin(self, dim=None, skipna=True, keep_dims=False): (I found keep_dims for indexes_min brings another confusion and omit from them).

  • isel_points's issue Currently, indexes_min works as ```python In [1]: import xarray as xr ...: da = xr.DataArray([[1, 2], [51, 40], [5, 6]], ...: [('x', ['c', 'b', 'a']), ('y', [1.4, 4.3])]) ...: da ...: Out[1]: <xarray.DataArray (x: 3, y: 2)> array([[ 1, 2], [51, 40], [ 5, 6]]) Coordinates:

  • x (x) <U1 'c' 'b' 'a'
  • y (y) float64 1.4 4.3

In [2]: da.indexes_min(dims='y') Out[2]: <xarray.Dataset> Dimensions: (x: 3) Coordinates: * x (x) <U1 'c' 'b' 'a' Data variables: y (x) float64 0 1 0

```

However, arguments of isel_points should be like python <xarray.Dataset> Dimensions: (points: 3) Data variables: x (points) int64 0 1 2 y (points) int64 0 1 0

This behavior is more intuitive?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Argmin indexes 239918314
312998916 https://github.com/pydata/xarray/pull/1469#issuecomment-312998916 https://api.github.com/repos/pydata/xarray/issues/1469 MDEyOklzc3VlQ29tbWVudDMxMjk5ODkxNg== shoyer 1217238 2017-07-05T05:21:45Z 2017-07-05T05:21:45Z MEMBER

OK, I think I finally understand the nuance of the return value -- thanks for describing that fully for me.

In theory (after #974 is implemented), the current return value from indexes_min should work for indexing, e.g., ```

indexes = da.indexes_min(dims='y') indexes <xarray.Dataset> Dimensions: (x: 3) Coordinates: * x (x) <U1 'c' 'b' 'a' Data variables: y (x) int64 0 1 0

da.sel(x=indexes.x, y=indexes.y) # or ds.sel(**indexes) <xarray.DataArray (x: 3)> array([ 1, 40, 5]) Coordinates: * x (x) <U1 'c' 'b' 'a' ``` So maybe that is the right choice, though I'm not entirely certain yet.

Side note: I'm still not super happy with the names idxmin and indexes_min. They look too different for methods that are only a small variation on each other. Maybe idxmin_dataset or idxmin_dict?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Argmin indexes 239918314
312745886 https://github.com/pydata/xarray/pull/1469#issuecomment-312745886 https://api.github.com/repos/pydata/xarray/issues/1469 MDEyOklzc3VlQ29tbWVudDMxMjc0NTg4Ng== shoyer 1217238 2017-07-03T22:49:39Z 2017-07-03T22:49:39Z MEMBER

A few quick thoughts on API design:

  • The most similar pandas method is called idxmin. We may not want to use the exact same name here, but it's something to keep in mind.
  • We might want two separate methods, one like this that returns an OrderedDict/Dataset and another that returns just one DataArray (for use when reducing over only one axis). I might pick idxmin and indexes_min.
  • A keep_dims=True argument like numpy is a nice way to preserve dimensions if desired.
  • I'm a little surprised that it doesn't work to unpack a Dataset with ** in isel_points -- in theory I think it should.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Argmin indexes 239918314

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 13.835ms · About: xarray-datasette