home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 180676935 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 3

  • shoyer 1
  • benbovy 1
  • stale[bot] 1

author_association 2

  • MEMBER 2
  • NONE 1

issue 1

  • Concatenate multiple variables into one variable with a multi-index (categories) · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
457808785 https://github.com/pydata/xarray/issues/1030#issuecomment-457808785 https://api.github.com/repos/pydata/xarray/issues/1030 MDEyOklzc3VlQ29tbWVudDQ1NzgwODc4NQ== stale[bot] 26384082 2019-01-26T07:06:43Z 2019-01-26T07:06:43Z NONE

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here; otherwise it will be marked as closed automatically

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Concatenate multiple variables into one variable with a multi-index (categories) 180676935
251355756 https://github.com/pydata/xarray/issues/1030#issuecomment-251355756 https://api.github.com/repos/pydata/xarray/issues/1030 MDEyOklzc3VlQ29tbWVudDI1MTM1NTc1Ng== benbovy 4160723 2016-10-04T10:48:17Z 2016-10-04T10:49:56Z MEMBER

Thanks for the tip @shoyer !

Using something like combined.set_index(spectrum=['band', 'wn']) or xr.concat(arrays, dim={'spectrum': ['band', 'wn']}) would be nice, although it may be a bit weird to use the key spectrum to rename the wn dimension here.

For now, I'm fine with setting the MultIndex using the more explicit - though more verbose - combined.set_index(wn=['band', 'wn']).rename({'wn': 'spectrum'})

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Concatenate multiple variables into one variable with a multi-index (categories) 180676935
251154675 https://github.com/pydata/xarray/issues/1030#issuecomment-251154675 https://api.github.com/repos/pydata/xarray/issues/1030 MDEyOklzc3VlQ29tbWVudDI1MTE1NDY3NQ== shoyer 1217238 2016-10-03T16:29:27Z 2016-10-03T16:29:27Z MEMBER

One option that gets you part way there:

python arrays = [ds['data_band%d' % i].rename({'wn_band%d' % i: 'wn'}).assign_coords(band=i) for i in range(1, 4)] combined = xr.concat(arrays, dim='wn')

This would still need some work (e.g., with set_index #1028) to set the MultiIndex. Ideally, maybe you could write something like combined.set_index(spectrum=['band', 'wn']) to create the new dimension and MultiIndex all at once.

It does seem like something like the key argument to pandas.concat would make sense here: http://pandas.pydata.org/pandas-docs/stable/merging.html#more-concatenating-with-group-keys

The API is not so obvious for us, though, because we need to supply the new dimension name and levels all at once. Maybe something like xr.concat(arrays, dim={'spectrum': ['band', 'wn']} would work.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Concatenate multiple variables into one variable with a multi-index (categories) 180676935

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