home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

21 rows where issue = 309691307 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 11

  • benbovy 4
  • shoyer 3
  • gewitterblitz 3
  • covertg 2
  • dcherian 2
  • max-sixty 2
  • ivanakcheurov 1
  • crusaderky 1
  • dhruvbalwada 1
  • stale[bot] 1
  • aberges-grd 1

author_association 2

  • MEMBER 12
  • NONE 9

issue 1

  • slice using non-index coordinates · 21 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1423154722 https://github.com/pydata/xarray/issues/2028#issuecomment-1423154722 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85U054i gewitterblitz 13985417 2023-02-08T19:47:22Z 2023-02-08T19:47:22Z NONE

Thanks, @benbovy. Yep, the kdtree objects don't like the range based slices. xoak has worked well in the past though. I'll keep an eye on xoak-xarray integration.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1422518769 https://github.com/pydata/xarray/issues/2028#issuecomment-1422518769 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85Uyenx benbovy 4160723 2023-02-08T12:29:27Z 2023-02-08T12:41:00Z MEMBER

@gewitterblitz there is a kdtree-based index example in #7041 that works with multi-dimensional coordinates. You could also have a look at https://xoak.readthedocs.io/en/latest/ (it doesn't use Xarray indexes - soon hopefully - so the current API is via Xarray accessors).

EDIT: seeing your previous https://github.com/pydata/xarray/issues/2028#issuecomment-921926536, not sure how you could use slices for label selection using those indexes as I don't think the wrapped scipy / sklearn kdtree objects support range queries. Other spatial indexes may support it (e.g., there's an example in https://github.com/martinfleis/xvec of selecting points using a shapely.box, although currently it only supports 1-d geometry coordinates).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1422003293 https://github.com/pydata/xarray/issues/2028#issuecomment-1422003293 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85Uwgxd gewitterblitz 13985417 2023-02-08T04:52:23Z 2023-02-08T04:52:23Z NONE

Thanks @benbovy, it works well. I am curious about using set_xindex with 2-dimensional non-index coordinates. A use case could be datasets with x and y coordinates that need to be subset using longitude (x,y) and latitude (x,y) values. Any suggestions?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1421222703 https://github.com/pydata/xarray/issues/2028#issuecomment-1421222703 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85UtiMv benbovy 4160723 2023-02-07T18:01:39Z 2023-02-07T18:01:39Z MEMBER

@aberges-grd If your non-index coordinate supports it (I guess it does?), you could assign a default index to the coordinate with set_xindex and then use slices for selection like any other (dimension) coordinate backed by a pandas index.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1421060924 https://github.com/pydata/xarray/issues/2028#issuecomment-1421060924 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85Us6s8 aberges-grd 103256364 2023-02-07T16:28:53Z 2023-02-07T16:28:53Z NONE

What about slices? My non-index coord is a datetime, and I need to select between two dates.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1265252754 https://github.com/pydata/xarray/issues/2028#issuecomment-1265252754 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85LajmS benbovy 4160723 2022-10-03T10:38:57Z 2022-10-03T16:45:35Z MEMBER

With the last release v2022.09.0, this is now possible via .set_xindex():

```python a = a.set_xindex("currency")

a.sel(currency="EUR")

<xarray.DataArray (country: 2)>

array([20, 30])

Coordinates:

* country (country) <U7 'Germany' 'France'

* currency (country) <U3 'EUR' 'EUR'

```

Closed in #6971 (although set_xindex still needs to be documented in the User Guide).

{
    "total_count": 9,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 5,
    "confused": 0,
    "heart": 3,
    "rocket": 1,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1203169477 https://github.com/pydata/xarray/issues/2028#issuecomment-1203169477 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85HtujF covertg 1542825 2022-08-02T20:13:41Z 2022-08-02T20:13:41Z NONE

Exciting news!! Thanks for the quick response and the huge amount of work on explicit indexes. I'll be excited and grateful to enjoy the public API once it comes into its own :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1202467717 https://github.com/pydata/xarray/issues/2028#issuecomment-1202467717 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85HrDOF benbovy 4160723 2022-08-02T12:48:47Z 2022-08-02T12:49:37Z MEMBER

Hi @covertg, as soon as there is public API for setting non-dimension or custom indexes it should be ready. See #6849, which is actually already implemented in the scipy22 branch (+ an example here). I plan to re-submit it as a proper PR within the few coming weeks.

{
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 2,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1202434941 https://github.com/pydata/xarray/issues/2028#issuecomment-1202434941 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85Hq7N9 covertg 1542825 2022-08-02T12:35:00Z 2022-08-02T12:35:00Z NONE

Hi all, wanted to ask what the status of this feature request is given all of the recent work by @benbovy on explicit indexes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
1146877847 https://github.com/pydata/xarray/issues/2028#issuecomment-1146877847 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X85EW_eX ivanakcheurov 5347026 2022-06-05T20:24:20Z 2022-06-05T20:24:20Z NONE

I agree this is harder that it should be.

Here's one way:

python In [28]: a.where(a.currency=='EUR', drop=True) Out[28]: <xarray.DataArray (country: 2)> array([20., 30.]) Coordinates: * country (country) <U7 'Germany' 'France' currency (country) <U3 'EUR' 'EUR'

I'm not sure whether .sel should work for non-IndexVariables - thoughts?

@max-sixty , perhaps there is any update on OPs question or maybe you can help to achieve the following? I would like sel based on a non-dim coordinate to be as fast as sel based on the dim itself. Timings: ```python

sel based on a non-dim coordinate

(using this coordinate directly .sel(product_id=26) would result in error "'no index found for coordinate product_id")

%timeit xds.sel(product=xds.product_id==26) 1.54 ms ± 64.2 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

sel based on the dim itself

%timeit xds.sel(product='GN91 Glove Medium') 499 µs ± 16.1 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

%timeit xds.where(xds.product_id==26, drop=True) 4.17 ms ± 39 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) ``` Anyways, xarray is brilliant and made my week :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
923098243 https://github.com/pydata/xarray/issues/2028#issuecomment-923098243 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X843BVyD dcherian 2448579 2021-09-20T16:46:28Z 2021-09-20T16:46:28Z MEMBER

xoak should work here: https://xoak.readthedocs.io/en/latest/

Here's an example with ocean model output: https://pop-tools.readthedocs.io/en/latest/examples/xoak-example.html .

If you can wait a while, this will all work better once #5692 is merged.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
921926536 https://github.com/pydata/xarray/issues/2028#issuecomment-921926536 https://api.github.com/repos/pydata/xarray/issues/2028 IC_kwDOAMm_X84283uI gewitterblitz 13985417 2021-09-17T16:27:14Z 2021-09-17T16:31:55Z NONE

@dcherian any recoomendations for 2D non-dim coords?

I would like to subset a dataarray based on slices for x and y coordinates

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
614031935 https://github.com/pydata/xarray/issues/2028#issuecomment-614031935 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDYxNDAzMTkzNQ== dcherian 2448579 2020-04-15T13:12:50Z 2020-04-15T13:12:50Z MEMBER

3925 would fix this for 1D non-dim coords. We should update the docs (ping @TomNicholas)

{
    "total_count": 4,
    "+1": 4,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
613802224 https://github.com/pydata/xarray/issues/2028#issuecomment-613802224 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDYxMzgwMjIyNA== dhruvbalwada 18236610 2020-04-15T03:58:35Z 2020-04-15T03:58:52Z NONE

I am a little confused about the documentation relating to this issue. It says in the documentation at http://xarray.pydata.org/en/stable/data-structures.html#coordinates "non-dimension coordinates are variables that contain coordinate data, but are not a dimension coordinate. They can be multidimensional (see Working with Multidimensional Coordinates), and there is no relationship between the name of a non-dimension coordinate and the name(s) of its dimension(s). Non-dimension coordinates can be useful for indexing or plotting; otherwise, xarray does not make any direct use of the values associated with them. They are not used for alignment or automatic indexing, nor are they required to match when doing arithmetic (see Coordinates)."

Is this an issue that has been resolved, and if so an example on how to do this would be helpful in the documentation. If not, should the documentation be corrected?

{
    "total_count": 2,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 2
}
  slice using non-index coordinates 309691307
592475338 https://github.com/pydata/xarray/issues/2028#issuecomment-592475338 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDU5MjQ3NTMzOA== crusaderky 6213168 2020-02-28T11:35:04Z 2020-02-28T11:35:04Z MEMBER

Still relevant

{
    "total_count": 8,
    "+1": 8,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
592100301 https://github.com/pydata/xarray/issues/2028#issuecomment-592100301 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDU5MjEwMDMwMQ== stale[bot] 26384082 2020-02-27T18:11:35Z 2020-02-27T18:11:35Z NONE

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
377318151 https://github.com/pydata/xarray/issues/2028#issuecomment-377318151 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDM3NzMxODE1MQ== shoyer 1217238 2018-03-29T17:51:27Z 2018-03-29T17:51:27Z MEMBER

@maxim-lian Probably. Or you could make the pandas.Index explicitly, e.g., da.sel(a=da.c.to_index().get_indexer(['x', 'y'])).

We should really add DataArray.isin() (https://github.com/pydata/xarray/issues/1268).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
377316057 https://github.com/pydata/xarray/issues/2028#issuecomment-377316057 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDM3NzMxNjA1Nw== max-sixty 5635139 2018-03-29T17:44:11Z 2018-03-29T17:44:11Z MEMBER

What's the easiest way to select on multiple values? Is it really this:

```python In [63]: da = xr.DataArray(np.random.rand(3,2), dims=list('ab'), coords={'c':(('a',),list('xyz'))})

In [64]: da.sel(a=(np.isin(da.c, list('xy')))) Out[64]: <xarray.DataArray (a: 2, b: 2)> array([[0.383989, 0.174317], [0.698948, 0.815993]]) Coordinates: c (a) <U1 'x' 'y' Dimensions without coordinates: a, b ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
377311481 https://github.com/pydata/xarray/issues/2028#issuecomment-377311481 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDM3NzMxMTQ4MQ== shoyer 1217238 2018-03-29T17:28:58Z 2018-03-29T17:28:58Z MEMBER

This has some connections to the broader indexes refactor envisioned in https://github.com/pydata/xarray/issues/1603.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
377311169 https://github.com/pydata/xarray/issues/2028#issuecomment-377311169 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDM3NzMxMTE2OQ== shoyer 1217238 2018-03-29T17:28:14Z 2018-03-29T17:28:14Z MEMBER

we're discussed this before: https://github.com/pydata/xarray/issues/934

I agree that this would be nice to support in theory. The challenge is that we would need to create (and then possibly throw away?) a pandas.Index do to the actual indexing, or use a numpy search function like np.isin(). Neither of these are very efficient.

Conceptually, I think it makes sense to support indexing on arbitrary variables, which is simply more expensive if an index is not already set. Dimension coordinates would not be special except that they have indexes created automatically.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307
377306186 https://github.com/pydata/xarray/issues/2028#issuecomment-377306186 https://api.github.com/repos/pydata/xarray/issues/2028 MDEyOklzc3VlQ29tbWVudDM3NzMwNjE4Ng== max-sixty 5635139 2018-03-29T17:12:21Z 2018-03-29T17:12:21Z MEMBER

I agree this is harder that it should be.

Here's one way: ```python

In [28]: a.where(a.currency=='EUR', drop=True) Out[28]: <xarray.DataArray (country: 2)> array([20., 30.]) Coordinates: * country (country) <U7 'Germany' 'France' currency (country) <U3 'EUR' 'EUR' ```

I'm not sure whether .sel should work for non-IndexVariables - thoughts?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  slice using non-index coordinates 309691307

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 1517.644ms · About: xarray-datasette