home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 246502828 and user = 1217238 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • shoyer · 5 ✖

issue 1

  • ENH: three argument version of where · 5 ✖

author_association 1

  • MEMBER 5
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
319477348 https://github.com/pydata/xarray/pull/1496#issuecomment-319477348 https://api.github.com/repos/pydata/xarray/issues/1496 MDEyOklzc3VlQ29tbWVudDMxOTQ3NzM0OA== shoyer 1217238 2017-08-01T19:50:52Z 2017-08-01T19:50:52Z MEMBER

I had meant: 'exact' includes other having a subset of dimensions, where the missing dimensions are easy to broadcast out

Yes, that works :). Exact only requires that common dimensions have the same lengths/labels, not that all arguments have the same dimensions.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: three argument version of where 246502828
319426805 https://github.com/pydata/xarray/pull/1496#issuecomment-319426805 https://api.github.com/repos/pydata/xarray/issues/1496 MDEyOklzc3VlQ29tbWVudDMxOTQyNjgwNQ== shoyer 1217238 2017-08-01T16:40:01Z 2017-08-01T16:40:01Z MEMBER

Does exact allow a scalar on a dimension? That's then simple and unambiguous to broadcast.

I'm not quite sure what you mean by this, can you explain?

I think the answer is probably no (but perhaps we could change that)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: three argument version of where 246502828
318959273 https://github.com/pydata/xarray/pull/1496#issuecomment-318959273 https://api.github.com/repos/pydata/xarray/issues/1496 MDEyOklzc3VlQ29tbWVudDMxODk1OTI3Mw== shoyer 1217238 2017-07-31T03:34:45Z 2017-07-31T03:34:45Z MEMBER

@spencerahill It sounds like we should just add the function, too, so you can write xr.where(cond, -2, 0). It's a only a few more lines of code.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: three argument version of where 246502828
318932648 https://github.com/pydata/xarray/pull/1496#issuecomment-318932648 https://api.github.com/repos/pydata/xarray/issues/1496 MDEyOklzc3VlQ29tbWVudDMxODkzMjY0OA== shoyer 1217238 2017-07-30T21:57:51Z 2017-07-30T21:57:51Z MEMBER

How difficult would it be to include np.where's option to provide values for both where the condition is met and where it isn't?

That works, too, e.g., In [6]: a.where(a.x + a.y < 5, -a) Out[6]: <xarray.DataArray (x: 5, y: 5)> array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, -9], [ 10, 11, 12, -13, -14], [ 15, 16, -17, -18, -19], [ 20, -21, -22, -23, -24]]) Dimensions without coordinates: x, y

You can even put Dataset objects in any of the arguments and it should broadcast across variables.

One annoyance is that instead of where(cond, x, y), you need to write this in the slightly counter-intuitive form x.where(cond, y). This is consistent with pandas, but we could also consider exposing the where(cond, x, y) version publicly as a function.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: three argument version of where 246502828
318872962 https://github.com/pydata/xarray/pull/1496#issuecomment-318872962 https://api.github.com/repos/pydata/xarray/issues/1496 MDEyOklzc3VlQ29tbWVudDMxODg3Mjk2Mg== shoyer 1217238 2017-07-30T02:19:26Z 2017-07-30T02:19:26Z MEMBER

One design decision here is how to handle alignment. The current version of where does an inner join between self and cond, but that wasn't carefully thought through -- more a side effect of making using of the binary arithmetic machinery.

I don't like this behavior for the three argument version of where, because it means that the indexes of other could remove non-NA values from the result, even if the condition is always True. This goes against one of our general principles, which is not aligning away non-missing values.

We can't use an outer join because we don't know how to handle NaNs in cond. We have a couple of other options: 1. We could require exact alignment for the three argument signature. This is simple and we already have the machinery. 2. We could require exact alignment to cond, but do some sort of more flexible alignment (e.g., an outer join) for self and other. This would require (at least) two calls to align() when other is provided, e.g., possibly ``` self, other = align(self, other, join='outer') self, other, cond = align(self, other, cond, join='inner')

still need to handle aligning data variables for Dataset objects

```

I am inclined to require exact alignment (i.e., join='exact') when three arguments are provided, because I know how to implement it correctly, and it still preserves the option of switching to more flexible alignment in the future.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: three argument version of where 246502828

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