home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

1 row where issue = 323839238 and user = 22245117 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

  • malmans2 · 1 ✖

issue 1

  • Dataset.resample() adds time dimension to independant variables · 1 ✖

author_association 1

  • CONTRIBUTOR 1
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
390267025 https://github.com/pydata/xarray/issues/2145#issuecomment-390267025 https://api.github.com/repos/pydata/xarray/issues/2145 MDEyOklzc3VlQ29tbWVudDM5MDI2NzAyNQ== malmans2 22245117 2018-05-18T16:50:47Z 2018-05-22T19:18:34Z CONTRIBUTOR

In my previous comment I said that this would be useful for staggered grids, but then I realized that resample only operates on the time dimension. Anyway, here is my example:

```python import xarray as xr import pandas as pd import numpy as np

Create coordinates

time = pd.date_range('1/1/2018', periods=365, freq='D') space = pd.np.arange(10)

Create random variables

var_withtime1 = np.random.randn(len(time), len(space)) var_withtime2 = np.random.randn(len(time), len(space)) var_timeless1 = np.random.randn(len(space)) var_timeless2 = np.random.randn(len(space))

Create dataset

ds = xr.Dataset({'var_withtime1': (['time', 'space'], var_withtime1), 'var_withtime2': (['time', 'space'], var_withtime2), 'var_timeless1': (['space'], var_timeless1), 'var_timeless2': (['space'], var_timeless2)}, coords={'time': (['time',], time), 'space': (['space',], space)})

Standard resample: this add the time dimension to the timeless variables

ds_resampled = ds.resample(time='1M').mean()

My workaround: this does not add the time dimension to the timeless variables

ds_withtime = ds.drop([ var for var in ds.variables if not 'time' in ds[var].dims ]) ds_timeless = ds.drop([ var for var in ds.variables if 'time' in ds[var].dims ]) ds_workaround = xr.merge([ds_timeless, ds_withtime.resample(time='1M').mean()]) ```

Datasets: ```

ds <xarray.Dataset> Dimensions: (space: 10, time: 365) Coordinates: * time (time) datetime64[ns] 2018-01-01 2018-01-02 2018-01-03 ... * space (space) int64 0 1 2 3 4 5 6 7 8 9 Data variables: var_withtime1 (time, space) float64 -1.137 -0.5727 -1.287 0.8102 ... var_withtime2 (time, space) float64 1.406 0.8448 1.276 0.02579 0.5684 ... var_timeless1 (space) float64 0.02073 -2.117 -0.2891 1.735 -1.535 0.209 ... var_timeless2 (space) float64 0.4357 -0.3257 -0.8321 0.8409 0.1454 ...

ds_resampled <xarray.Dataset> Dimensions: (space: 10, time: 12) Coordinates: * time (time) datetime64[ns] 2018-01-31 2018-02-28 2018-03-31 ... * space (space) int64 0 1 2 3 4 5 6 7 8 9 Data variables: var_withtime1 (time, space) float64 0.08149 0.02121 -0.05635 0.1788 ... var_withtime2 (time, space) float64 0.08991 0.5728 0.05394 0.214 0.3523 ... var_timeless1 (time, space) float64 0.02073 -2.117 -0.2891 1.735 -1.535 ... var_timeless2 (time, space) float64 0.4357 -0.3257 -0.8321 0.8409 ...

ds_workaround <xarray.Dataset> Dimensions: (space: 10, time: 12) Coordinates: * space (space) int64 0 1 2 3 4 5 6 7 8 9 * time (time) datetime64[ns] 2018-01-31 2018-02-28 2018-03-31 ... Data variables: var_timeless1 (space) float64 0.4582 -0.6946 -0.3451 1.183 -1.14 0.1849 ... var_timeless2 (space) float64 1.658 -0.1719 -0.2202 -0.1789 -1.247 ... var_withtime1 (time, space) float64 -0.3901 0.3725 0.02935 -0.1315 ... var_withtime2 (time, space) float64 0.07145 -0.08536 0.07049 0.1025 ... ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.resample() adds time dimension to independant variables 323839238

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