home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 173494017 and user = 1063143 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

  • joonro · 4 ✖

issue 1

  • Return a scalar instead of DataArray when the return value is a scalar · 4 ✖

author_association 1

  • NONE 4
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
242953090 https://github.com/pydata/xarray/issues/987#issuecomment-242953090 https://api.github.com/repos/pydata/xarray/issues/987 MDEyOklzc3VlQ29tbWVudDI0Mjk1MzA5MA== joonro 1063143 2016-08-28T02:58:24Z 2016-08-28T02:58:24Z NONE

@shoyer I think I saw ... a long time ago and must have forgotten about it. Thank you so much for reminding me - I was really hoping for something like ... for a while.

Btw, I must say not only that xarray is just so useful for many of my research, but also the devs' responses on the issues have been superb. Definitely one of the most pleasant experiences I have had with developers. Thank you.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Return a scalar instead of DataArray when the return value is a scalar 173494017
242940333 https://github.com/pydata/xarray/issues/987#issuecomment-242940333 https://api.github.com/repos/pydata/xarray/issues/987 MDEyOklzc3VlQ29tbWVudDI0Mjk0MDMzMw== joonro 1063143 2016-08-27T20:55:59Z 2016-08-27T20:59:09Z NONE

Sure. My actual usage is usually much more complicated, but basically, with

python import numpy as np import xarray as xr X = xr.DataArray(np.random.normal(size=(10, 10)), coords=[range(10), range(10)],)

if I want to choose only values larger than 0 from X, it seems I cannot do X[X > 0], I have to do X.values[X.values > 0]. You can see how this thing can quickly get long if I'm doing this for assignment with multidimensional xarrays - something like

python X.loc[:, :, :, 'variable'].values[X.loc[:, :, :, 'variable'].values > 0] = Y.loc[:, :, :, 'variable'].values[Y.loc[:, :, :, 'variable'].values > 0]

Maybe I'm mistaken and there is a way to do this more nicely, but I haven't been able to figure it out.

Thank you!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Return a scalar instead of DataArray when the return value is a scalar 173494017
242937958 https://github.com/pydata/xarray/issues/987#issuecomment-242937958 https://api.github.com/repos/pydata/xarray/issues/987 MDEyOklzc3VlQ29tbWVudDI0MjkzNzk1OA== joonro 1063143 2016-08-27T20:06:12Z 2016-08-27T20:06:12Z NONE

Thanks a lot for the discussions. I agree it is very important to be consistent and explicit. Another thing was that sometimes .values makes a line of code really long - especially when I want to index a DataArray with another DataArray with some conditions, as I often have to use .values for each of them.

Currently I do not have a good idea about how to improve this - I will report back if one occurs to me. Thanks again!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Return a scalar instead of DataArray when the return value is a scalar 173494017
242796865 https://github.com/pydata/xarray/issues/987#issuecomment-242796865 https://api.github.com/repos/pydata/xarray/issues/987 MDEyOklzc3VlQ29tbWVudDI0Mjc5Njg2NQ== joonro 1063143 2016-08-26T17:22:06Z 2016-08-26T17:22:06Z NONE

I see - thanks a lot for the quick response. I knew there was a good reason for this.

I wonder if it is reasonable to return a scalar when there is neither coords nor attrs associated with the return value, or it would be too much ad-hoc thing. For example, in the original example the return value was <xarray.DataArray ()>, which does not have any useful information.

I think this might be reasonable because I only get into this issue when I'm doing an array-wide operation and I know I'm going to get an aggregate scalar and forget to use .values.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Return a scalar instead of DataArray when the return value is a scalar 173494017

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