home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 218302130

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/650#issuecomment-218302130 https://api.github.com/repos/pydata/xarray/issues/650 218302130 MDEyOklzc3VlQ29tbWVudDIxODMwMjEzMA== 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
}
  115933483
Powered by Datasette · Queries took 0.666ms · About: xarray-datasette