{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/9581","labels_url":"https://api.github.com/repos/pydata/pandas/issues/9581/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/9581/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/9581/events","html_url":"https://github.com/pydata/pandas/issues/9581","id":59696298,"number":9581,"title":"issubdtype(<categorical>, np.bool_) raises error","user":{"login":"JanSchulz","id":890156,"avatar_url":"https://avatars.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/JanSchulz","html_url":"https://github.com/JanSchulz","followers_url":"https://api.github.com/users/JanSchulz/followers","following_url":"https://api.github.com/users/JanSchulz/following{/other_user}","gists_url":"https://api.github.com/users/JanSchulz/gists{/gist_id}","starred_url":"https://api.github.com/users/JanSchulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanSchulz/subscriptions","organizations_url":"https://api.github.com/users/JanSchulz/orgs","repos_url":"https://api.github.com/users/JanSchulz/repos","events_url":"https://api.github.com/users/JanSchulz/events{/privacy}","received_events_url":"https://api.github.com/users/JanSchulz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Categorical","name":"Categorical","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-03T19:57:28Z","updated_at":"2015-03-03T21:33:48Z","closed_at":null,"body":"```python\r\nIn[14]: import pandas as pd\r\nBackend Qt4Agg is interactive backend. Turning interactive mode on.\r\nIn[15]: import numpy as np\r\nIn[16]: s = pd.Series([1,2,3,1,2,3]).astype(\"category\")\r\nIn[17]: s\r\nOut[17]: \r\n0    1\r\n1    2\r\n2    3\r\n3    1\r\n4    2\r\n5    3\r\ndtype: category\r\nCategories (3, int64): [1 < 2 < 3]\r\nIn[18]: np.issubdtype(s.dtype, np.bool_)\r\nTraceback (most recent call last):\r\n  File \"c:\\data\\external\\ipython\\IPython\\core\\interactiveshell.py\", line 3032, in run_code\r\n    exec(code_obj, self.user_global_ns, self.user_ns)\r\n  File \"<ipython-input-18-607a91e2a828>\", line 1, in <module>\r\n    np.issubdtype(s.dtype, np.bool_)\r\n  File \"C:\\portabel\\miniconda\\envs\\ipython\\lib\\site-packages\\numpy\\core\\numerictypes.py\", line 763, in issubdtype\r\n    return issubclass(dtype(arg1).type, arg2)\r\nTypeError: data type not understood\r\n```\r\n\r\nThis is a problem in https://github.com/pydata/patsy/pull/47\r\n\r\nNot sure if there is an easy way to get numpy to understand this (I've absolute no numpy foo :-/ ). If not this means that every patsy/statsmodels method which does dtype magic has to guard against the category dtype :-/"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/77039890","html_url":"https://github.com/pydata/pandas/issues/9581#issuecomment-77039890","issue_url":"https://api.github.com/repos/pydata/pandas/issues/9581","id":77039890,"user":{"login":"JanSchulz","id":890156,"avatar_url":"https://avatars.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/JanSchulz","html_url":"https://github.com/JanSchulz","followers_url":"https://api.github.com/users/JanSchulz/followers","following_url":"https://api.github.com/users/JanSchulz/following{/other_user}","gists_url":"https://api.github.com/users/JanSchulz/gists{/gist_id}","starred_url":"https://api.github.com/users/JanSchulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanSchulz/subscriptions","organizations_url":"https://api.github.com/users/JanSchulz/orgs","repos_url":"https://api.github.com/users/JanSchulz/repos","events_url":"https://api.github.com/users/JanSchulz/events{/privacy}","received_events_url":"https://api.github.com/users/JanSchulz/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T21:33:48Z","updated_at":"2015-03-03T21:33:48Z","body":"The problem is that (this and probably other) code worked great before pandas 0.15 and works great as long as no categorical comes along but then breaks if you pass in a categorical. So more or less the categorical introduction breaks unrelated code. :-("}}