{"action":"created","issue":{"url":"https://api.github.com/repos/blaze/dask/issues/867","labels_url":"https://api.github.com/repos/blaze/dask/issues/867/labels{/name}","comments_url":"https://api.github.com/repos/blaze/dask/issues/867/comments","events_url":"https://api.github.com/repos/blaze/dask/issues/867/events","html_url":"https://github.com/blaze/dask/issues/867","id":120758553,"number":867,"title":"array slicing with multiple dimensions is broken","user":{"login":"jeremyherbert","id":52499,"avatar_url":"https://avatars.githubusercontent.com/u/52499?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremyherbert","html_url":"https://github.com/jeremyherbert","followers_url":"https://api.github.com/users/jeremyherbert/followers","following_url":"https://api.github.com/users/jeremyherbert/following{/other_user}","gists_url":"https://api.github.com/users/jeremyherbert/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremyherbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremyherbert/subscriptions","organizations_url":"https://api.github.com/users/jeremyherbert/orgs","repos_url":"https://api.github.com/users/jeremyherbert/repos","events_url":"https://api.github.com/users/jeremyherbert/events{/privacy}","received_events_url":"https://api.github.com/users/jeremyherbert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-07T11:56:45Z","updated_at":"2015-12-08T04:04:31Z","closed_at":null,"body":"Hi,\r\n\r\nI can run the following code in numpy just fine:\r\n\r\n```\r\nimport numpy as np\r\n\r\ndata = np.arange(1e6).reshape((1e6/4, 4))\r\nprint(data.shape)\r\n\r\ndata_reshaped = data[:50, 1].reshape((2, 25))\r\nprint(data_reshaped.shape)\r\n\r\n### prints out:\r\n# (250000, 4)\r\n# (2, 25)\r\n```\r\n\r\nbut in dask, it throws an exception:\r\n```\r\nimport numpy as np\r\nimport dask.array as da\r\n\r\ndata = np.arange(1e6).reshape((1e6/4, 4))\r\nprint(data.shape) # this prints ok\r\n\r\ndask_array = da.from_array(data, chunks=(100, ))\r\ndata_reshaped = dask_array[:50, 1].reshape((2, 25))\r\nprint(data_reshaped.compute().shape)\r\n```\r\n\r\nand the traceback:\r\n```\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-10-0a3ca0ea6699> in <module>()\r\n      7 dask_array = da.from_array(data, chunks=(100, ))\r\n      8 data_reshaped = dask_array[:50, 1].reshape((2, 25))\r\n----> 9 print(data_reshaped.compute().shape)\r\n     10 \r\n\r\n/Users/jeremy/anaconda/lib/python3.5/site-packages/dask/base.py in compute(self, **kwargs)\r\n     32 \r\n     33     def compute(self, **kwargs):\r\n---> 34         return compute(self, **kwargs)[0]\r\n     35 \r\n     36     @classmethod\r\n\r\n/Users/jeremy/anaconda/lib/python3.5/site-packages/dask/base.py in compute(*args, **kwargs)\r\n    100                 for opt, val in groups.items()])\r\n    101     keys = [arg._keys() for arg in args]\r\n--> 102     results = get(dsk, keys, **kwargs)\r\n    103     return tuple(a._finalize(a, r) for a, r in zip(args, results))\r\n    104 \r\n\r\n/Users/jeremy/anaconda/lib/python3.5/site-packages/dask/threaded.py in get(dsk, result, cache, num_workers, **kwargs)\r\n     55     results = get_async(pool.apply_async, len(pool._pool), dsk, result,\r\n     56                         cache=cache, queue=queue, get_id=_thread_get_id,\r\n---> 57                         **kwargs)\r\n     58 \r\n     59     return results\r\n\r\n/Users/jeremy/anaconda/lib/python3.5/site-packages/dask/async.py in get_async(apply_async, num_workers, dsk, result, cache, queue, get_id, raise_on_exception, rerun_exceptions_locally, callbacks, **kwargs)\r\n    481                 _execute_task(task, data)  # Re-execute locally\r\n    482             else:\r\n--> 483                 raise(remote_exception(res, tb))\r\n    484         state['cache'][key] = res\r\n    485         finish_task(dsk, key, state, results, keyorder.get)\r\n\r\nValueError: total size of new array must be unchanged\r\n\r\nTraceback\r\n---------\r\n  File \"/Users/jeremy/anaconda/lib/python3.5/site-packages/dask/async.py\", line 263, in execute_task\r\n    result = _execute_task(task, data)\r\n  File \"/Users/jeremy/anaconda/lib/python3.5/site-packages/dask/async.py\", line 245, in _execute_task\r\n    return func(*args2)\r\n  File \"/Users/jeremy/anaconda/lib/python3.5/site-packages/numpy/core/fromnumeric.py\", line 225, in reshape\r\n    return reshape(newshape, order=order)\r\n```\r\n\r\nCan anyone help me understand what is going wrong here?"},"comment":{"url":"https://api.github.com/repos/blaze/dask/issues/comments/162752906","html_url":"https://github.com/blaze/dask/issues/867#issuecomment-162752906","issue_url":"https://api.github.com/repos/blaze/dask/issues/867","id":162752906,"user":{"login":"jeremyherbert","id":52499,"avatar_url":"https://avatars.githubusercontent.com/u/52499?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremyherbert","html_url":"https://github.com/jeremyherbert","followers_url":"https://api.github.com/users/jeremyherbert/followers","following_url":"https://api.github.com/users/jeremyherbert/following{/other_user}","gists_url":"https://api.github.com/users/jeremyherbert/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremyherbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremyherbert/subscriptions","organizations_url":"https://api.github.com/users/jeremyherbert/orgs","repos_url":"https://api.github.com/users/jeremyherbert/repos","events_url":"https://api.github.com/users/jeremyherbert/events{/privacy}","received_events_url":"https://api.github.com/users/jeremyherbert/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T04:04:31Z","updated_at":"2015-12-08T04:04:31Z","body":"fantastic, thank you! I will leave this to you to close."}}