issues: 70015421
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70015421 | MDExOlB1bGxSZXF1ZXN0MzM4MjQzMDc= | 399 | Dataset.to_array and DataArray.to_dataset methods | 1217238 | closed | 0 | 987654 | 0 | 2015-04-22T03:59:56Z | 2015-04-22T04:34:56Z | 2015-04-22T04:34:54Z | MEMBER | 0 | pydata/xarray/pulls/399 | These methods make it easy to switch back and forth between data arrays and datasets: ``` In [4]: ds = xray.Dataset({'a': 1, 'b': ('x', [1, 2, 3])}, ...: coords={'c': 42}, attrs={'Conventions': 'None'}) ...: In [5]: ds.to_array() Out[5]: <xray.DataArray (variables: 2, x: 3)> array([[1, 1, 1], [1, 2, 3]]) Coordinates: c int64 42 * x (x) int64 0 1 2 * variables (variables) |S1 'a' 'b' Attributes: Conventions: None In [6]: ds.to_array().to_dataset(dim='variables') Out[6]: <xray.Dataset> Dimensions: (x: 3) Coordinates: c int64 42 * x (x) int64 0 1 2 Data variables: a (x) int64 1 1 1 b (x) int64 1 2 3 Attributes: Conventions: None ``` Fixes #132 CC @IamJeffG |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/399/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | pull |