home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 204071440 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 6

  • gerritholl 2
  • shoyer 2
  • ulijh 2
  • jfburkhart 1
  • jhamman 1
  • keewis 1

author_association 3

  • CONTRIBUTOR 4
  • MEMBER 4
  • NONE 1

issue 1

  • Cannot use xarrays own times for indexing · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
682435326 https://github.com/pydata/xarray/issues/1240#issuecomment-682435326 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDY4MjQzNTMyNg== gerritholl 500246 2020-08-28T09:48:18Z 2020-08-28T09:48:56Z CONTRIBUTOR

I fixed my conda environment now (something was wrong as I appeared to have two xarray installations in parallel). I still get the KeyError with latest xarray master and latest pandas master:

$ conda list | egrep -w '(pandas|xarray)' pandas 1.2.0.dev0+167.g1f35b0621 pypi_0 pypi xarray 0.16.1.dev65+g13caf96e pypi_0 pypi $ python mwe83.py Traceback (most recent call last): File "mwe83.py", line 5, in <module> da.sel(time=da.coords["time"][0]) File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/dataarray.py", line 1142, in sel ds = self._to_temp_dataset().sel( File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/dataset.py", line 2096, in sel pos_indexers, new_indexes = remap_label_indexers( File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/coordinates.py", line 395, in remap_label_indexers pos_indexers, new_indexes = indexing.remap_label_indexers( File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/indexing.py", line 270, in remap_label_indexers idxr, new_idx = convert_label_indexer(index, label, dim, method, tolerance) File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/indexing.py", line 189, in convert_label_indexer indexer = index.get_loc( File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/pandas/core/indexes/datetimes.py", line 622, in get_loc raise KeyError(key) KeyError: 0 $ cat mwe83.py import xarray as xr import numpy as np da = xr.DataArray([0, 1], dims=("time",), coords={"time": np.array([0, 1], dtype="M8[s]")}) da.sel(time=slice(da.coords["time"][0], da.coords["time"][1])) da.sel(time=da.coords["time"][0])

Oops, by "already have" you meant it's already been reported, I thought you meant it had already been fixed. All clear then.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440
682419176 https://github.com/pydata/xarray/issues/1240#issuecomment-682419176 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDY4MjQxOTE3Ng== keewis 14808389 2020-08-28T09:10:47Z 2020-08-28T09:10:47Z MEMBER

What's your pandas version? If it's pandas>=1.1.0, we already have #4283. Otherwise you might want to update your repository, we're at 13caf96efb3f121e232a35aafceed80c832a9876 right now (the latest release is 0.16.0).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440
682393298 https://github.com/pydata/xarray/issues/1240#issuecomment-682393298 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDY4MjM5MzI5OA== gerritholl 500246 2020-08-28T08:14:26Z 2020-08-28T08:14:26Z CONTRIBUTOR

This was closed and was solved for slicing, but not for element indexing:

python import xarray as xr import numpy as np da = xr.DataArray([0, 1], dims=("time",), coords={"time": np.array([0, 1], dtype="M8[s]")}) da.sel(time=da.coords["time"][0])

results in

Traceback (most recent call last): File "mwe83.py", line 4, in <module> da.sel(time=da.coords["time"][0]) File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/dataarray.py", line 1142, in sel ds = self._to_temp_dataset().sel( File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/dataset.py", line 2096, in sel pos_indexers, new_indexes = remap_label_indexers( File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/coordinates.py", line 395, in remap_label_indexers pos_indexers, new_indexes = indexing.remap_label_indexers( File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/indexing.py", line 270, in remap_label_indexers idxr, new_idx = convert_label_indexer(index, label, dim, method, tolerance) File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/xarray/core/indexing.py", line 189, in convert_label_indexer indexer = index.get_loc( File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/pandas/core/indexes/datetimes.py", line 622, in get_loc raise KeyError(key) KeyError: 0

using xarray 0.15.2.dev64+g2542a63f (latest master). I think it would be desirable that it works in both cases. Should we reopen this issue or should I open a new?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440
346158815 https://github.com/pydata/xarray/issues/1240#issuecomment-346158815 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDM0NjE1ODgxNQ== shoyer 1217238 2017-11-21T20:58:34Z 2017-11-21T20:58:34Z MEMBER

Sorry for letting this one linger for so long... I added the "bug" tag so we don't forget about it for the next release.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440
346157283 https://github.com/pydata/xarray/issues/1240#issuecomment-346157283 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDM0NjE1NzI4Mw== ulijh 13190237 2017-11-21T20:52:49Z 2017-11-21T20:52:49Z CONTRIBUTOR

@jhamman - thanks, this should be usefull...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440
346059153 https://github.com/pydata/xarray/issues/1240#issuecomment-346059153 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDM0NjA1OTE1Mw== jhamman 2443309 2017-11-21T15:20:09Z 2017-11-21T15:20:09Z MEMBER

@ulijh - you should be able to use the time index:

Python In [11]: arr.loc[arr.indexes['time'][2]:arr.indexes['time'][5]] Out[11]: <xarray.DataArray (time: 4, space: 3)> array([[ 0.422991, 0.513276, 0.762432], [ 0.111123, 0.371109, 0.697921], [ 0.029415, 0.215116, 0.451697], [ 0.670181, 0.855551, 0.319134]]) Coordinates: * time (time) datetime64[ns] 2000-01-03 2000-01-04 2000-01-05 2000-01-06 * space (space) <U2 'IA' 'IL' 'IN'

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440
346037822 https://github.com/pydata/xarray/issues/1240#issuecomment-346037822 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDM0NjAzNzgyMg== ulijh 13190237 2017-11-21T14:11:36Z 2017-11-21T14:11:36Z CONTRIBUTOR

Hi, this is still the case for version 0.10.0. arr = xr.DataArray(np.random.rand(10, 3), ...: [('time', pd.date_range('2000-01-01', periods=10)), ...: ('space', ['IA', 'IL', 'IN'])]) ...: arr.loc[arr.time[2]:arr.time[5]] fails, but doing the same thing on a pandas dataframe works just fine: dfr = arr.to_dataframe(name='dfr') dfr.loc[arr.time[2]:arr.time[5]] I'd really appreciate see this working on a DataArray.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440
304742391 https://github.com/pydata/xarray/issues/1240#issuecomment-304742391 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDMwNDc0MjM5MQ== jfburkhart 109530 2017-05-29T23:09:26Z 2017-05-29T23:09:26Z NONE

I get the same error when trying to do: depo[depo.sel(time=slice(tmp.time[0],tmp.time[-1]))] = tmp Where both depo and tmp are DataArrays. Do you have an example solution/workaround?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440
276131405 https://github.com/pydata/xarray/issues/1240#issuecomment-276131405 https://api.github.com/repos/pydata/xarray/issues/1240 MDEyOklzc3VlQ29tbWVudDI3NjEzMTQwNQ== shoyer 1217238 2017-01-30T17:39:05Z 2017-01-30T17:39:15Z MEMBER

Yes, this is annoying. We already have some work arounds for this in xarray -- see _as_array_or_item in xarray/core/variable.py. I would be happy to add a similar work around to fix slicing.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Cannot use xarrays own times for indexing 204071440

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 1515.453ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows