home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 603944176

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/issues/3287#issuecomment-603944176 https://api.github.com/repos/pydata/xarray/issues/3287 603944176 MDEyOklzc3VlQ29tbWVudDYwMzk0NDE3Ng== 5635139 2020-03-25T16:30:20Z 2020-03-25T16:30:20Z MEMBER

Re the reordering; that's the case, though it does reorder the dimension, not just the coord (i.e. it's still correctly aligned). Slight change to the original example to demonstrate.

``` In [18]: data = np.arange(2).reshape((2,1,1)) ...: dims = ['c', 'y', 'x'] ...: ...: d1 = xr.DataArray(data, dims=dims) ...: g1 = d1.stack(f=['c', 'x']).groupby('f').first() ...: print('Expected dim names:') ...: print(g1.coords) ...: print() ...: ...: d2 = xr.DataArray(data, dims=dims, coords={'c': ['R', 'G']}) ...: g2 = d2.stack(f=['c', 'x']).groupby('f').first() ...: print('Unexpected dim names:') ...: print(g2.coords) Expected dim names: Coordinates: * f (f) MultiIndex - c (f) int64 0 1 - x (f) int64 0 0

Unexpected dim names: Coordinates: * f (f) MultiIndex - f_level_0 (f) object 'G' 'R' - f_level_1 (f) int64 0 0

In [19]: d2 Out[19]: <xarray.DataArray (c: 2, y: 1, x: 1)> array([[[0]],

   [[1]]])

Coordinates: * c (c) <U1 'R' 'G' Dimensions without coordinates: y, x

In [20]: g2 Out[20]: <xarray.DataArray (y: 1, f: 2)> array([[1, 0]]) Coordinates: * f (f) MultiIndex - f_level_0 (f) object 'G' 'R' - f_level_1 (f) int64 0 0 Dimensions without coordinates: y ```

Yes that second reference looks like the place @spencerahill!

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