issue_comments: 436784481
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/issues/1115#issuecomment-436784481 | https://api.github.com/repos/pydata/xarray/issues/1115 | 436784481 | MDEyOklzc3VlQ29tbWVudDQzNjc4NDQ4MQ== | 5635139 | 2018-11-07T21:31:12Z | 2018-11-07T21:31:18Z | MEMBER | For posterity, I made a small adjustment to @shoyer 's draft: ```python untested!def covariance(x, y, dim=None): # need to ensure the dim lengths are the same - i.e. no auto-aligning # could use count-1 for sample return xr.dot(x - x.mean(dim), y - y.mean(dim), dims=dim) / x.count(dim) def correlation(x, y, dim=None): # dim should default to the intersection of x.dims and y.dims return covariance(x, y, dim) / (x.std(dim) * y.std(dim)) ``` |
{
"total_count": 2,
"+1": 2,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
188996339 |