issues: 361237908
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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 361237908 | MDU6SXNzdWUzNjEyMzc5MDg= | 2419 | Document ways to reshape a DataArray | 9844249 | open | 0 | 5 | 2018-09-18T10:27:36Z | 2022-04-09T02:21:15Z | NONE | Code Sample, a copy-pastable example if possibleA "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you: http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports ```python Your code heredef xr_reshape(A, dim, newdims, coords): """ Reshape DataArray A to convert its dimension dim into sub-dimensions given by newdims and the corresponding coords. Example: Ar = xr_reshape(A, 'time', ['year', 'month'], [(2017, 2018), np.arange(12)]) """
``` Problem description[this should explain why the current behavior is a problem and why the expected output is a better solution.] It would be great to have the above function as a DataArray's method. Expected OutputA reshaped DataArray. In the example in the function comment it would correspond to an array like In[1] Ar.dims Out[1]: ('year', 'month', 'lat', 'lon') Output of
|
{
"url": "https://api.github.com/repos/pydata/xarray/issues/2419/reactions",
"total_count": 2,
"+1": 2,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
13221727 | issue |