{"action":"created","issue":{"url":"https://api.github.com/repos/xray/xray/issues/458","labels_url":"https://api.github.com/repos/xray/xray/issues/458/labels{/name}","comments_url":"https://api.github.com/repos/xray/xray/issues/458/comments","events_url":"https://api.github.com/repos/xray/xray/issues/458/events","html_url":"https://github.com/xray/xray/issues/458","id":94030797,"number":458,"title":"groupby / apply and dask (`open_mfdataset`)","user":{"login":"razvanc87","id":1177508,"avatar_url":"https://avatars.githubusercontent.com/u/1177508?v=3","gravatar_id":"","url":"https://api.github.com/users/razvanc87","html_url":"https://github.com/razvanc87","followers_url":"https://api.github.com/users/razvanc87/followers","following_url":"https://api.github.com/users/razvanc87/following{/other_user}","gists_url":"https://api.github.com/users/razvanc87/gists{/gist_id}","starred_url":"https://api.github.com/users/razvanc87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/razvanc87/subscriptions","organizations_url":"https://api.github.com/users/razvanc87/orgs","repos_url":"https://api.github.com/users/razvanc87/repos","events_url":"https://api.github.com/users/razvanc87/events{/privacy}","received_events_url":"https://api.github.com/users/razvanc87/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-09T12:10:04Z","updated_at":"2015-07-15T00:02:34Z","closed_at":"2015-07-15T00:02:34Z","body":"It seems that, when working with `open_mfdataset`, things are not consistent. Trying the following:\r\n```python\r\nimport numpy as np\r\nimport xray\r\na = xray.open_mfdataset('*.nc', concat_dim='time', preprocess=lambda x: x.assign_coords(agl=('mean_height_agl', range(x.dims['mean_height_agl']))).swap_dims({'mean_height_agl': 'agl'}).squeeze('time'))\r\na.groupby('time').apply(np.sum)\r\n```\r\n\r\ngives an error with a huge traceback that ends with:\r\n```python\r\nIndexError:  Exception in remote process\r\n\r\ntuple index out of range\r\n\r\nTraceback:\r\n  File \"/home/razvan/.local/lib/python3.4/site-packages/dask/async.py\", line 260, in execute_task\r\n    result = _execute_task(task, data)\r\n  File \"/home/razvan/.local/lib/python3.4/site-packages/dask/async.py\", line 243, in _execute_task\r\n    return func(*args2)\r\n  File \"/home/razvan/.local/lib/python3.4/site-packages/toolz/functoolz.py\", line 378, in __call__\r\n    ret = fns[0](*args, **kwargs)\r\n  File \"/home/razvan/.local/lib/python3.4/site-packages/dask/array/core.py\", line 377, in _concatenate2\r\n```\r\n\r\nbut if I do:\r\n```python\r\na.load()\r\na.groupby('time').apply(np.sum)\r\n```\r\nthere's no error. The files I'm using for this are at [this dropbox place](https://www.dropbox.com/sh/wnyana6rgefevmg/AAAzmm37L34A7xKTFbyiy3Aoa?dl=0)."},"comment":{"url":"https://api.github.com/repos/xray/xray/issues/comments/121432005","html_url":"https://github.com/xray/xray/issues/458#issuecomment-121432005","issue_url":"https://api.github.com/repos/xray/xray/issues/458","id":121432005,"user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T00:02:33Z","updated_at":"2015-07-15T00:02:33Z","body":"This was https://github.com/ContinuumIO/dask/issues/391, which has now been fixed upstream in dask. Thanks @mrocklin!"}}