{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/5936","labels_url":"https://api.github.com/repos/numpy/numpy/issues/5936/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/5936/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/5936/events","html_url":"https://github.com/numpy/numpy/issues/5936","id":84549056,"number":5936,"title":"AttributeError when splitting empty Pandas DataFrame using numpy.array_split","user":{"login":"budiaji","id":5643597,"avatar_url":"https://avatars.githubusercontent.com/u/5643597?v=3","gravatar_id":"","url":"https://api.github.com/users/budiaji","html_url":"https://github.com/budiaji","followers_url":"https://api.github.com/users/budiaji/followers","following_url":"https://api.github.com/users/budiaji/following{/other_user}","gists_url":"https://api.github.com/users/budiaji/gists{/gist_id}","starred_url":"https://api.github.com/users/budiaji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/budiaji/subscriptions","organizations_url":"https://api.github.com/users/budiaji/orgs","repos_url":"https://api.github.com/users/budiaji/repos","events_url":"https://api.github.com/users/budiaji/events{/privacy}","received_events_url":"https://api.github.com/users/budiaji/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-03T12:54:35Z","updated_at":"2015-06-03T13:33:38Z","closed_at":null,"body":"I use **numpy.array_split** to split [Pandas DataFrame] (http://pandas.pydata.org/pandas-docs/version/0.16.1/dsintro.html?highlight=dataframe#dataframe) into list of smaller dataframes. \r\nI use Pandas version. When I use numpy version 1.8.2, everything seems OK. But when I use numpy version 1.9.2, I got the following error: \r\n```\r\n/home/neira/envs/ia_core/lib/python2.7/site-packages/numpy/lib/shape_base.py:430: FutureWarning: in the future np.array_split will retain the shape of arrays with a zero size, instead of replacing them by `array([])`, which always has a shape of (0,).\r\n  FutureWarning)\r\n---------------------------------------------------------------------------\r\nAttributeError                            Traceback (most recent call last)\r\n<ipython-input-5-9a9a9d7baf22> in <module>()\r\n----> 1 b = np.array_split(a,1)\r\n\r\n/home/neira/envs/ia_core/lib/python2.7/site-packages/numpy/lib/shape_base.pyc in array_split(ary, indices_or_sections, axis)\r\n    429                       \"`array([])`, which always has a shape of (0,).\",\r\n    430                       FutureWarning)\r\n--> 431         sub_arys = _replace_zero_by_x_arrays(sub_arys)\r\n    432 \r\n    433     return sub_arys\r\n\r\n/home/neira/envs/ia_core/lib/python2.7/site-packages/numpy/lib/shape_base.pyc in _replace_zero_by_x_arrays(sub_arys)\r\n    372             sub_arys[i] = _nx.empty(0, dtype=sub_arys[i].dtype)\r\n    373         elif _nx.sometrue(_nx.equal(_nx.shape(sub_arys[i]), 0)):\r\n--> 374             sub_arys[i] = _nx.empty(0, dtype=sub_arys[i].dtype)\r\n    375     return sub_arys\r\n    376 \r\n\r\n/home/neira/envs/ia_core/lib/python2.7/site-packages/pandas/core/generic.pyc in __getattr__(self, name)\r\n   1976                 return self[name]\r\n   1977             raise AttributeError(\"'%s' object has no attribute '%s'\" %\r\n-> 1978                                  (type(self).__name__, name))\r\n   1979 \r\n   1980     def __setattr__(self, name, value):\r\n\r\nAttributeError: 'DataFrame' object has no attribute 'dtype'\r\n```\r\nHere is code to reproduce that error:\r\n```Python\r\nimport numpy as np\r\nimport pandas as pd\r\na = pd.DataFrame()\r\nb = np.array_split(a,1)\r\n```\r\n\r\nI use Ubuntu 14.04."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/108414388","html_url":"https://github.com/numpy/numpy/issues/5936#issuecomment-108414388","issue_url":"https://api.github.com/repos/numpy/numpy/issues/5936","id":108414388,"user":{"login":"juliantaylor","id":542663,"avatar_url":"https://avatars.githubusercontent.com/u/542663?v=3","gravatar_id":"","url":"https://api.github.com/users/juliantaylor","html_url":"https://github.com/juliantaylor","followers_url":"https://api.github.com/users/juliantaylor/followers","following_url":"https://api.github.com/users/juliantaylor/following{/other_user}","gists_url":"https://api.github.com/users/juliantaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/juliantaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliantaylor/subscriptions","organizations_url":"https://api.github.com/users/juliantaylor/orgs","repos_url":"https://api.github.com/users/juliantaylor/repos","events_url":"https://api.github.com/users/juliantaylor/events{/privacy}","received_events_url":"https://api.github.com/users/juliantaylor/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T13:33:38Z","updated_at":"2015-06-03T13:33:38Z","body":"c91b4c3703eef84eca84063994d07332020c7707 is to blame, though I don't think you can expect any numpy functions to work on pandas frames. Especially since it doesn't inherit from ndarray anymore"}}