issues: 255989233
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
255989233 | MDU6SXNzdWUyNTU5ODkyMzM= | 1560 | DataArray.unstack taking unreasonable amounts of memory | 167802 | closed | 0 | 11 | 2017-09-07T16:01:50Z | 2018-08-15T00:18:28Z | 2018-08-15T00:18:28Z | CONTRIBUTOR | Hi, While trying to support DataArrays in pyresample, I stumble upon what seems to me to be a bug. It looks like unstacking a dimension takes unreasonable amounts of memory. For example: ```python from xarray import DataArray import numpy as np arr = DataArray(np.empty([1, 8996, 9223])).stack(flat_dim=['dim_1', 'dim_2']) print(arr) arr.unstack('flat_dim') ``` peaks at about 8GB of my memory (in top), while the array in itself isn't supposed to take more than 635MB approximately. I know my measuring method is not very accurate, but should it be this way ? As a side note, the unstacking also takes a very long time. What is going on under the hood ? Martin |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/1560/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |