home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "MEMBER", issue = 115933483 and user = 10194086 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

  • mathause · 4 ✖

issue 1

  • Feature/average · 4 ✖

author_association 1

  • MEMBER · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
218304910 https://github.com/pydata/xarray/pull/650#issuecomment-218304910 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDIxODMwNDkxMA== mathause 10194086 2016-05-10T22:00:35Z 2016-05-10T22:00:35Z MEMBER

I could imagine to continue working on this - however, there are some open design questions: - Do we include skipna? (I would say yes) - Do we allow the weights to contain NaN? (I would say yes, although disallowing it would make it easier.) - Does skipna also apply to the weights or are NaNs always skipped in the weights? (I would suggest the latter.) - Do we need a skipna_weights for a fine grained control of this? (This sounds unnecessary) - Do you agree with the above given examples?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
218302130 https://github.com/pydata/xarray/pull/650#issuecomment-218302130 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDIxODMwMjEzMA== mathause 10194086 2016-05-10T21:48:02Z 2016-05-10T21:48:02Z MEMBER

It seems incorporating this to mean may not be very practical and average not the cleanest solution. Do you know if a weighted mean is planned in pandas?

Anyway, I have tried to put together some corner cases whre there are NaN in the data or the weights. Unfortunately there is no np.nanaverage, so I also compared it to np.ma.average. I put together a gist with a lot of examples:

https://gist.github.com/mathause/720cbca2d97597a99534581b8ca296a5

The above implementation works fine, however there are currently two cases where I expect another answer:

``` data = [1, np.nan]; weights = [0, 1.]

0. ```

I think this should return NaN.

``` data = [1, 1.]; weights = [np.nan, np.nan]

0 data = [1, 1.]; weights = [np.nan, 0] 0 ```

I think these should also return NaN.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
186214729 https://github.com/pydata/xarray/pull/650#issuecomment-186214729 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE4NjIxNDcyOQ== mathause 10194086 2016-02-19T13:34:33Z 2016-02-19T13:34:33Z MEMBER

I am fine having it as extra method. I think it is an important feature to have - I use this function every day.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
156154844 https://github.com/pydata/xarray/pull/650#issuecomment-156154844 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE1NjE1NDg0NA== mathause 10194086 2015-11-12T16:24:02Z 2015-11-12T16:24:02Z MEMBER

Didn't realize you were working on this. Pulling it into mean is fine for me (if you need the weights it is a one-liner). average in numpy seems comparatively complicated - maybe that's why it got it's own function... - average with no valid elements (or 0 weight) seems to return NaN which is fine - maybe you need to add tests when the data contains NaN

@jhamman you showed this in a lecture? cool :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483

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