home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "CONTRIBUTOR" and 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 2

  • gerritholl 2
  • ulijh 2

issue 1

  • Cannot use xarrays own times for indexing · 4 ✖

author_association 1

  • CONTRIBUTOR · 4 ✖
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
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
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
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

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