issues: 203999231
This data as json
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
203999231 | MDU6SXNzdWUyMDM5OTkyMzE= | 1238 | `set_index` converts string-dtype to object-dtype | 500246 | open | 0 | 10 | 2017-01-30T12:37:05Z | 2023-03-13T14:09:21Z | CONTRIBUTOR | 'Dataset.set_index' apparently changes a ``` In [108]: ds = xarray.Dataset({"x": (("a", "b"), arange(25).reshape(5,5)+100), "y": ("b", arange(5)-100)}, {"a": arange(5), "b": arange(5)*2, "c": (("a",), list("ABCDE"))}) In [109]: print(ds) <xarray.Dataset> Dimensions: (a: 5, b: 5) Coordinates: * b (b) int64 0 2 4 6 8 c (a) <U1 'A' 'B' 'C' 'D' 'E' * a (a) int64 0 1 2 3 4 Data variables: x (a, b) int64 100 101 102 103 104 105 106 107 108 109 110 111 ... y (b) int64 -100 -99 -98 -97 -96 In [110]: print(ds.set_index(a='c')) <xarray.Dataset> Dimensions: (a: 5, b: 5) Coordinates: * b (b) int64 0 2 4 6 8 * a (a) object 'A' 'B' 'C' 'D' 'E' Data variables: x (a, b) int64 100 101 102 103 104 105 106 107 108 109 110 111 ... y (b) int64 -100 -99 -98 -97 -96 ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/1238/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |