home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

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

  • shoyer 5
  • jhamman 5
  • mathause 4
  • max-sixty 2

issue 1

  • Feature/average · 16 ✖

author_association 1

  • MEMBER · 16 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
218358483 https://github.com/pydata/xarray/pull/650#issuecomment-218358483 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDIxODM1ODQ4Mw== jhamman 2443309 2016-05-11T04:25:04Z 2016-05-11T04:25:04Z MEMBER

@MaximilianR - I really like this idea. I'm going to close this PR and we can continue to discuss this feature in the original issue (https://github.com/pydata/xarray/issues/422#issuecomment-218358372).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
218321387 https://github.com/pydata/xarray/pull/650#issuecomment-218321387 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDIxODMyMTM4Nw== shoyer 1217238 2016-05-10T23:28:52Z 2016-05-10T23:28:52Z MEMBER

@MaximilianR great idea! A groupby like interface is much cleaner than adding more orthogonal code paths to .mean and the like.

{
    "total_count": 3,
    "+1": 0,
    "-1": 1,
    "laugh": 0,
    "hooray": 2,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
218315882 https://github.com/pydata/xarray/pull/650#issuecomment-218315882 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDIxODMxNTg4Mg== max-sixty 5635139 2016-05-10T22:54:51Z 2016-05-10T22:54:51Z MEMBER

How about designing this as a groupby-like interface? In the same way as .rolling (or .expanding & .ewm in pandas)?

So for example ds.weighted(weights=ds.dim).mean().

And then this is extensible, clean, pandan-tic.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
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
218302515 https://github.com/pydata/xarray/pull/650#issuecomment-218302515 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDIxODMwMjUxNQ== shoyer 1217238 2016-05-10T21:49:53Z 2016-05-10T21:49:53Z MEMBER

Do you know if a weighted mean is planned in pandas?

Like most new features for pandas (or xarray, for that matter), there isn't anyone who has committed to working on it -- it will depend on the interest of a contributor.

{
    "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
186354428 https://github.com/pydata/xarray/pull/650#issuecomment-186354428 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE4NjM1NDQyOA== shoyer 1217238 2016-02-19T18:36:22Z 2016-02-19T18:37:47Z MEMBER

I would still lean toward trying to put this into mean. You already have most of what you need -- it would just be a matter of dropping mean from the list of injected methods.

https://github.com/pydata/xarray/issues/770 might help with some of the redundant code (if/when we get around to it).

{
    "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
185542959 https://github.com/pydata/xarray/pull/650#issuecomment-185542959 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE4NTU0Mjk1OQ== jhamman 2443309 2016-02-18T05:00:58Z 2016-02-18T05:00:58Z MEMBER

I'm doing some cleanup on my outstanding issues/PRs. After thinking about this again, I'm not all than keen on pushing this into the mean method. I actually think it will end up being a bit of an ordeal to make happen. mean is currently injected as one of the NAN_REDUCE_METHODS. Its not entirely clear to me if it will be "cleaner" to refactor mean to support weights. Thoughts?

{
    "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
156139264 https://github.com/pydata/xarray/pull/650#issuecomment-156139264 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE1NjEzOTI2NA== jhamman 2443309 2015-11-12T15:32:07Z 2015-11-12T15:32:35Z MEMBER

Okay, let's go with the mean refactor. We'll drop the returned arg and just add weights to the method.

@mathause - any comment?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
156018718 https://github.com/pydata/xarray/pull/650#issuecomment-156018718 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE1NjAxODcxOA== shoyer 1217238 2015-11-12T06:58:40Z 2015-11-12T06:58:40Z MEMBER

If you think the ability to return sum_of_weights is important, then this probably makes sense as a separate method -- that would be pretty confusing to add to mean. Otherwise, I would be inclined to simply add weights=None to mean. That would require a bit of refactoring but shouldn't be too bad.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
155478982 https://github.com/pydata/xarray/pull/650#issuecomment-155478982 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE1NTQ3ODk4Mg== jhamman 2443309 2015-11-10T16:34:41Z 2015-11-10T16:34:41Z MEMBER

Any thoughts on the tradeoff between adding average vs adding a weights argument to mean? I guess it's nice that this mirrors NumPy.

That would be the main motivation.

If Pandas is going the way of pydata/pandas#10030 via mean, I think we could do that as well. I actually like that approach more since we tend to call it a "weighted mean" (see title of pandas issue).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
155357189 https://github.com/pydata/xarray/pull/650#issuecomment-155357189 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE1NTM1NzE4OQ== shoyer 1217238 2015-11-10T08:29:44Z 2015-11-10T08:29:44Z MEMBER

Any thoughts on the tradeoff between adding average vs adding a weights argument to mean? I guess it's nice that this mirrors NumPy.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
155161359 https://github.com/pydata/xarray/pull/650#issuecomment-155161359 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE1NTE2MTM1OQ== jhamman 2443309 2015-11-09T19:16:29Z 2015-11-09T19:16:29Z MEMBER

Thanks @maximilianr. There has been an open issue here on this for a while (#422).

@shoyer - I'm actually not sure I love how I implemented this but I'm teaching a session on open source contributions and code review today so I threw this up here as an example.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Feature/average 115933483
155153560 https://github.com/pydata/xarray/pull/650#issuecomment-155153560 https://api.github.com/repos/pydata/xarray/issues/650 MDEyOklzc3VlQ29tbWVudDE1NTE1MzU2MA== max-sixty 5635139 2015-11-09T18:51:51Z 2015-11-09T18:51:51Z MEMBER

xref https://github.com/pydata/pandas/issues/10030

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