home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 326344778 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 4

  • fujiisoup 2
  • shoyer 1
  • IvoCrnkovic 1
  • stale[bot] 1

author_association 2

  • MEMBER 3
  • NONE 2

issue 1

  • converting int vars to floats when I where the enclosing ds? · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
619319476 https://github.com/pydata/xarray/issues/2183#issuecomment-619319476 https://api.github.com/repos/pydata/xarray/issues/2183 MDEyOklzc3VlQ29tbWVudDYxOTMxOTQ3Ng== stale[bot] 26384082 2020-04-25T04:39:50Z 2020-04-25T04:39:50Z 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
}
  converting int vars to floats when I where the enclosing ds? 326344778
391946696 https://github.com/pydata/xarray/issues/2183#issuecomment-391946696 https://api.github.com/repos/pydata/xarray/issues/2183 MDEyOklzc3VlQ29tbWVudDM5MTk0NjY5Ng== shoyer 1217238 2018-05-25T05:36:57Z 2018-05-25T05:36:57Z MEMBER

We might need to take a look at how where with drop=True is implemented internally to see if this is feasible, but I agree that in principle there is no reason to convert from int to float in that case.

{
    "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
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
391909574 https://github.com/pydata/xarray/issues/2183#issuecomment-391909574 https://api.github.com/repos/pydata/xarray/issues/2183 MDEyOklzc3VlQ29tbWVudDM5MTkwOTU3NA== IvoCrnkovic 1778852 2018-05-25T00:56:54Z 2018-05-25T00:56:54Z NONE

That makes sense, but in my example I don't introduce any np.nan values. The conversion to float happens anyway i guess?

{
    "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 13.141ms · About: xarray-datasette