{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/5611","labels_url":"https://api.github.com/repos/numpy/numpy/issues/5611/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/5611/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/5611/events","html_url":"https://github.com/numpy/numpy/issues/5611","id":59137502,"number":5611,"title":"Unexpected result when feeding empty array into atleast_2d","user":{"login":"mtrbean","id":222778,"avatar_url":"https://avatars.githubusercontent.com/u/222778?v=3","gravatar_id":"","url":"https://api.github.com/users/mtrbean","html_url":"https://github.com/mtrbean","followers_url":"https://api.github.com/users/mtrbean/followers","following_url":"https://api.github.com/users/mtrbean/following{/other_user}","gists_url":"https://api.github.com/users/mtrbean/gists{/gist_id}","starred_url":"https://api.github.com/users/mtrbean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtrbean/subscriptions","organizations_url":"https://api.github.com/users/mtrbean/orgs","repos_url":"https://api.github.com/users/mtrbean/repos","events_url":"https://api.github.com/users/mtrbean/events{/privacy}","received_events_url":"https://api.github.com/users/mtrbean/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-26T20:25:05Z","updated_at":"2015-02-26T23:38:41Z","closed_at":null,"body":"I was expecting a square array `array([], shape=(0, 0), dtype=float64)`, but got `shape=(1,0)`. Is this the intended behavior?\r\n\r\n    In [14]: np.empty(0).shape\r\n    Out[14]: (0,)\r\n\r\n    In [15]: np.atleast_2d(np.empty(0))\r\n    Out[15]: array([], shape=(1, 0), dtype=float64)\r\n\r\nThe reason is that I needed a 2D array from `hsplit` and `vhsplit`, but the dimension is not preserved when the result happens to be empty (gh-4102). I tried to work around the issue with `atleast_2d`, and found that it doesn't work because `atleast_2d` doesn't give me a square array with shape `(0,0)`"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/76299667","html_url":"https://github.com/numpy/numpy/issues/5611#issuecomment-76299667","issue_url":"https://api.github.com/repos/numpy/numpy/issues/5611","id":76299667,"user":{"login":"mtrbean","id":222778,"avatar_url":"https://avatars.githubusercontent.com/u/222778?v=3","gravatar_id":"","url":"https://api.github.com/users/mtrbean","html_url":"https://github.com/mtrbean","followers_url":"https://api.github.com/users/mtrbean/followers","following_url":"https://api.github.com/users/mtrbean/following{/other_user}","gists_url":"https://api.github.com/users/mtrbean/gists{/gist_id}","starred_url":"https://api.github.com/users/mtrbean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtrbean/subscriptions","organizations_url":"https://api.github.com/users/mtrbean/orgs","repos_url":"https://api.github.com/users/mtrbean/repos","events_url":"https://api.github.com/users/mtrbean/events{/privacy}","received_events_url":"https://api.github.com/users/mtrbean/received_events","type":"User","site_admin":false},"created_at":"2015-02-26T23:38:41Z","updated_at":"2015-02-26T23:38:41Z","body":"I was doing (doesn't work)\r\n\r\n    c1, c2   = np.vsplit(arr, [index])\r\n    c11, c12 = np.hsplit(c1, [index])\r\n    c21, c22 = np.hsplit(c2, [index])\r\n\r\nAnd now I'm using slicing. (This works for me)\r\n\r\n    c11 = arr[:index, :index]\r\n    c12 = arr[:index, index:]\r\n    c21 = arr[index:, :index]\r\n    c22 = arr[index:, index:]"}}