home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 415647225

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/2375#issuecomment-415647225 https://api.github.com/repos/pydata/xarray/issues/2375 415647225 MDEyOklzc3VlQ29tbWVudDQxNTY0NzIyNQ== 1217238 2018-08-24T04:24:33Z 2018-08-24T04:24:33Z MEMBER

It might make sense to use a list instead of a set here. On Thu, Aug 23, 2018 at 8:37 PM Keisuke Fujii notifications@github.com wrote:

@fujiisoup commented on this pull request.

Thanks. A few comments.

In xarray/core/dataset.py https://github.com/pydata/xarray/pull/2375#discussion_r212513643:

+ + missing_dims = [dim for dim in dims if dim not in self.dims] + if missing_dims: + raise ValueError('Dataset does not contain the dimensions: %s' + % missing_dims) + + non_multi_dims = [dim for dim in dims + if not isinstance(self.get_index(dim), pd.MultiIndex)] + if non_multi_dims and dim_from_kwarg: + raise ValueError('cannot unstack dimensions that do not ' + 'have a MultiIndex: %s' % non_multi_dims) + + dims = dims - set(non_multi_dims) + if len(dims) == 0: + raise ValueError('cannot unstack an object that does not have ' + 'MultiIndex dimensions')

I think that we can allow to unstack an object without MultiIndex, which just returns as is. It would be useful if users want to remove any MultiIndexes from an object.


In xarray/core/dataset.py https://github.com/pydata/xarray/pull/2375#discussion_r212513859:


  • unstacked : Dataset
  • Dataset with unstacked data. +
  • See also

  • Dataset.stack
  • """
  • dim_from_kwarg = dim is not None +
  • if isinstance(dim, basestring):
  • dims = set([dim])
  • elif dim is None:
  • dims = set(self.dims)
  • else:
  • dims = set(dim)

Maybe we can use OrderedSet instead of set so that the resultant dimension order is fixed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/pull/2375#pullrequestreview-149165031, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKS1k4sM5-2xSpTAI02Sa792Zqido7eks5uT3TggaJpZM4WGc2s .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  352677925
Powered by Datasette · Queries took 0.875ms · About: xarray-datasette