home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 352677925 and user = 6815844 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

  • fujiisoup · 2 ✖

issue 1

  • Make `dim` optional on unstack · 2 ✖

author_association 1

  • MEMBER 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
415201313 https://github.com/pydata/xarray/pull/2375#issuecomment-415201313 https://api.github.com/repos/pydata/xarray/issues/2375 MDEyOklzc3VlQ29tbWVudDQxNTIwMTMxMw== fujiisoup 6815844 2018-08-22T22:22:48Z 2018-08-22T22:22:48Z MEMBER

But maybe it is better to choose the first dim that is MultiIndex rather than the first dim.

first dimension is not well defined in Dataset, as it is a union of the dims of all the dataarrays it has. For example, in the following example, ds.unstack()['var'] and da['var'].unstack() will give different results.

```python In [15]: import numpy as np ...: import xarray as xr ...: ...: ds = xr.Dataset({'var': (('x', 'y', 'z', 'w'), np.random.randn(2,3,4,5))}) ...: ds = ds.stack(b=['z', 'w']).stack(a=['x', 'y']) ...: ds ...: Out[15]: <xarray.Dataset> Dimensions: (a: 6, b: 20) Coordinates: * b (b) MultiIndex - z (b) int64 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 - w (b) int64 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 * a (a) MultiIndex - x (a) int64 0 0 0 1 1 1 - y (a) int64 0 1 2 0 1 2 Data variables: var (b, a) float64 -1.277 -0.4031 -0.3816 ... 1.398 0.6763 -0.6735

In [16]: list(ds.dims) Out[16]: ['a', 'b']

In [17]: list(ds['var'].dims) Out[17]: ['b', 'a'] ```

but in that case should we allow passing in multiple dims?

I like this direction. stack accepts multiple pairs of dimensions to be stacked, like ds.stack(a=['x', 'y'], b=['z', 'w']). In this method, it repeatedly calls _stack_once method. I think unstack also can have the similar logic.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Make `dim` optional on unstack 352677925
414860789 https://github.com/pydata/xarray/pull/2375#issuecomment-414860789 https://api.github.com/repos/pydata/xarray/issues/2375 MDEyOklzc3VlQ29tbWVudDQxNDg2MDc4OQ== fujiisoup 6815844 2018-08-22T00:01:45Z 2018-08-22T00:01:45Z MEMBER

Thanks, @jsignell.

I like this idea (unstack without explicit dimension names), but I think we may need to decide what API would be the best. My particular concern is + what should be done if DataArray or Dataset has multiple MultiIndexes. Maybe do we unstack all the MultiIndexes? + we have similar method reset_index. Do we also want to make dim optional?

For unstack_like, I'm not sure it is worth adding as a top level function as xr.full_like(other, data).unstack() is simple enoguh...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Make `dim` optional on unstack 352677925

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