home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

1 row where repo = 13221727, state = "open" and user = 25231875 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue 1

state 1

  • open · 1 ✖

repo 1

  • xarray · 1 ✖
id node_id number title user state locked assignee milestone comments created_at updated_at ▲ closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
255597950 MDU6SXNzdWUyNTU1OTc5NTA= 1554 TypeError on DataArray.stack() if any of the dimensions to be stacked has a MultiIndex jjpr-mit 25231875 open 0     3 2017-09-06T13:09:30Z 2019-04-05T18:35:12Z   NONE      

If I call .stack() on a DataArray, and any of the dimensions to be stacked already has a MultiIndex on it, I get an error:

TypeError: Must pass list-like as `names`.

Maybe it doesn't make sense for .stack() to work on an existing MultiIndex, but that should probably be documented, and perhaps throw a more informative error.

Here's the full trace:

``` Traceback (most recent call last) <ipython-input-6-ce81ac38d71e> in <module>() ----> 1 xr_one_flat_stacked = xr_one_flat.stack(alphanumeric=("letters", "numbers")) 2 xr_one_flat_stacked

/Users/jjpr/anaconda/envs/dldata/lib/python2.7/site-packages/xarray/core/dataarray.pyc in stack(self, dimensions) 1027 DataArray.unstack 1028 """ -> 1029 ds = self._to_temp_dataset().stack(dimensions) 1030 return self._from_temp_dataset(ds) 1031

/Users/jjpr/anaconda/envs/dldata/lib/python2.7/site-packages/xarray/core/dataset.pyc in stack(self, **dimensions) 1832 result = self 1833 for new_dim, dims in dimensions.items(): -> 1834 result = result._stack_once(dims, new_dim) 1835 return result 1836

/Users/jjpr/anaconda/envs/dldata/lib/python2.7/site-packages/xarray/core/dataset.pyc in _stack_once(self, dims, new_dim) 1801 else level 1802 for level in levels] -> 1803 idx = utils.multiindex_from_product_levels(levels, names=dims) 1804 variables[new_dim] = IndexVariable(new_dim, idx) 1805

/Users/jjpr/anaconda/envs/dldata/lib/python2.7/site-packages/xarray/core/utils.pyc in multiindex_from_product_levels(levels, names) 79 indexing='ij') 80 labels = [x.ravel() for x in labels_mesh] ---> 81 return pd.MultiIndex(levels, labels, sortorder=0, names=names) 82 83

/Users/jjpr/anaconda/envs/dldata/lib/python2.7/site-packages/pandas/indexes/multi.pyc in new(cls, levels, labels, sortorder, names, copy, verify_integrity, _set_identity, name, **kwargs) 103 if names is not None: 104 # handles name validation --> 105 result._set_names(names) 106 107 if sortorder is not None:

/Users/jjpr/anaconda/envs/dldata/lib/python2.7/site-packages/pandas/indexes/multi.pyc in _set_names(self, names, level, validate) 505 # set the name 506 for l, name in zip(level, names): --> 507 self.levels[l].rename(name, inplace=True) 508 509 names = property(fset=_set_names, fget=_get_names,

/Users/jjpr/anaconda/envs/dldata/lib/python2.7/site-packages/pandas/indexes/base.pyc in set_names(self, names, level, inplace) 997 998 if not is_list_like(names) and level is None and self.nlevels > 1: --> 999 raise TypeError("Must pass list-like as names.") 1000 1001 if not is_list_like(names):

TypeError: Must pass list-like as names. ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1554/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 38.346ms · About: xarray-datasette