home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where author_association = "MEMBER", issue = 326344778 and user = 6815844 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • fujiisoup · 2 ✖

issue 1

  • converting int vars to floats when I where the enclosing ds? · 2 ✖

author_association 1

  • MEMBER · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
391910422 https://github.com/pydata/xarray/issues/2183#issuecomment-391910422 https://api.github.com/repos/pydata/xarray/issues/2183 MDEyOklzc3VlQ29tbWVudDM5MTkxMDQyMg== fujiisoup 6815844 2018-05-25T01:03:04Z 2018-05-25T01:03:04Z MEMBER

Reopening as I think we need to discuss this behavior more deeply.

The similar thing happens if we pass drop=True, ```python In [9]: test_ds.where(test_ds['var1'] == 1) Out[9]: <xarray.Dataset> Dimensions: (dim_0: 5) Dimensions without coordinates: dim_0 Data variables: var1 (dim_0) float64 nan 1.0 nan nan nan var2 (dim_0) float64 nan 1.0 nan nan nan

In [10]: test_ds.where(test_ds['var1'] == 1, drop=True) Out[10]: <xarray.Dataset> Dimensions: (dim_0: 1) Dimensions without coordinates: dim_0 Data variables: var1 (dim_0) float64 1.0 var2 (dim_0) float64 1.0 ```

I think that if with drop=False, the output dtype should be float even if all the items satisfies the condition. It makes the behavior consistent among the cases where the conditions are met or not.

My question, may be we need to discuss more, is drop=True case. In this case, there are never nan for any condition. Do we need to convert the dtype?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  converting int vars to floats when I where the enclosing ds? 326344778
391909283 https://github.com/pydata/xarray/issues/2183#issuecomment-391909283 https://api.github.com/repos/pydata/xarray/issues/2183 MDEyOklzc3VlQ29tbWVudDM5MTkwOTI4Mw== fujiisoup 6815844 2018-05-25T00:54:31Z 2018-05-25T00:54:31Z MEMBER

Thanks for the report. I agree this is somehow unintuitive, but it is an intended behavior. The reason is that np.nan is float.

Similar with your example python In [7]: test_ds.where(test_ds['var2'] == 2)['var1'] Out[7]: <xarray.DataArray 'var1' (dim_0: 5)> array([nan, nan, nan, nan, nan]) Dimensions without coordinates: dim_0 where nan is used to indicate where the condition is not satified.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  converting int vars to floats when I where the enclosing ds? 326344778

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