issue_comments
1 row where issue = 388901771 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- When use groupby to convert monthly array into yearly array by mean (dim=time), does xr consider the weights of each month or just take average? · 1 ✖
| id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 445452721 | https://github.com/pydata/xarray/issues/2594#issuecomment-445452721 | https://api.github.com/repos/pydata/xarray/issues/2594 | MDEyOklzc3VlQ29tbWVudDQ0NTQ1MjcyMQ== | spencerkclark 6628425 | 2018-12-08T11:36:16Z | 2018-12-08T11:36:16Z | MEMBER | It just takes the average. However if you have an array of weights, it is straightforward to use groupby to take a weighted mean: ```python import numpy as np import pandas as pd import xarray as xr times = pd.date_range('2001', periods=36, freq='MS') da = xr.DataArray(range(36), [('time', times)]) weights = times.shift(1, 'MS') - times weights = xr.DataArray(weights, [('time', times)]).astype('float') annual_means = ((da * weights).groupby('time.year').sum('time') / weights.groupby('time.year').sum('time')) ``` Note this assumes that your DataArray does not contain missing values. If your array has missing values, you might want to use something like this:
|
{
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
When use groupby to convert monthly array into yearly array by mean (dim=time), does xr consider the weights of each month or just take average? 388901771 |
Advanced export
JSON shape: default, array, newline-delimited, object
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]);
user 1