{"action":"created","issue":{"url":"https://api.github.com/repos/ContinuumIO/dask/issues/494","labels_url":"https://api.github.com/repos/ContinuumIO/dask/issues/494/labels{/name}","comments_url":"https://api.github.com/repos/ContinuumIO/dask/issues/494/comments","events_url":"https://api.github.com/repos/ContinuumIO/dask/issues/494/events","html_url":"https://github.com/ContinuumIO/dask/issues/494","id":98228807,"number":494,"title":"Another dask.array bug with scalar arrays","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-30T18:08:32Z","updated_at":"2015-07-30T18:26:47Z","closed_at":null,"body":"```\r\nimport dask.array as da\r\nimport numpy as np\r\n\r\nx = da.from_array(np.array(1.0), chunks=())\r\n(x == x).all().compute()\r\n# IndexError: tuple index out of range\r\n\r\n# or alternatively\r\n(x + x).sum().compute()\r\n```\r\n\r\nArguably, the source of this bug is the fact that numpy turns 0d arrays into scalars after binary operations:\r\n```\r\nIn [8]: a = np.array(1.0)\r\n\r\nIn [9]: a + a\r\nOut[9]: 2.0\r\n\r\nIn [10]: type(a + a)\r\nOut[10]: numpy.float64\r\n```\r\n\r\nUnfortunately, dask still needs to work around this..."},"comment":{"url":"https://api.github.com/repos/ContinuumIO/dask/issues/comments/126425150","html_url":"https://github.com/ContinuumIO/dask/issues/494#issuecomment-126425150","issue_url":"https://api.github.com/repos/ContinuumIO/dask/issues/494","id":126425150,"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-30T18:26:47Z","updated_at":"2015-07-30T18:26:47Z","body":"What do you think about explicitly inserting calls to `np.array` into the dask task graph for binary operations on scalar arrays?"}}