{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/10336","labels_url":"https://api.github.com/repos/pydata/pandas/issues/10336/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/10336/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/10336/events","html_url":"https://github.com/pydata/pandas/issues/10336","id":87592000,"number":10336,"title":"Dataframe Where Dataframe == False Returns Dataframe with Floats","user":{"login":"jaradc","id":12854767,"avatar_url":"https://avatars.githubusercontent.com/u/12854767?v=3","gravatar_id":"","url":"https://api.github.com/users/jaradc","html_url":"https://github.com/jaradc","followers_url":"https://api.github.com/users/jaradc/followers","following_url":"https://api.github.com/users/jaradc/following{/other_user}","gists_url":"https://api.github.com/users/jaradc/gists{/gist_id}","starred_url":"https://api.github.com/users/jaradc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaradc/subscriptions","organizations_url":"https://api.github.com/users/jaradc/orgs","repos_url":"https://api.github.com/users/jaradc/repos","events_url":"https://api.github.com/users/jaradc/events{/privacy}","received_events_url":"https://api.github.com/users/jaradc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-12T03:37:45Z","updated_at":"2015-06-12T12:12:33Z","closed_at":null,"body":"If I have a Dataframe with True/False values only like this:\r\n```\r\ndf_mask = pd.DataFrame({'AAA': [True] * 4,\r\n                        'BBB': [False]*4,\r\n                        'CCC': [True, False, True, False]}); print(df_mask)\r\n```\r\n```\r\n    AAA    BBB    CCC\r\n0  True  False   True\r\n1  True  False  False\r\n2  True  False   True\r\n3  True  False  False\r\n```\r\nThen try to `print` where the values in the dataframe is equivalent to `False` like so:\r\n\r\n```\r\nprint(df_mask[df_mask == False])\r\nprint(df_mask.where(df_mask == False))\r\n```\r\nMy question is about column `CCC`. Column `BBB` shows False (as I expect) but why is `index 1` and `3` in column `CCC` equal to `0` instead of `False`?\r\n```\r\n   AAA    BBB  CCC\r\n0  NaN  False  NaN\r\n1  NaN  False    0\r\n2  NaN  False  NaN\r\n3  NaN  False    0\r\n   AAA    BBB  CCC\r\n0  NaN  False  NaN\r\n1  NaN  False    0\r\n2  NaN  False  NaN\r\n3  NaN  False    0\r\n```\r\nWhy doesn't it return a dataframe that looks like this?\r\n```\r\n   AAA    BBB   CCC\r\n0  NaN  False   NaN\r\n1  NaN  False False\r\n2  NaN  False   NaN\r\n3  NaN  False False\r\n```\r\n\r\nI was asked to post this question here.  I originally posted this on [StackOverflow here](http://stackoverflow.com/questions/30701068/python-pandas-boolean-dataframe-where-dataframe-equals-false-returns-0-instead)."},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/111473168","html_url":"https://github.com/pydata/pandas/issues/10336#issuecomment-111473168","issue_url":"https://api.github.com/repos/pydata/pandas/issues/10336","id":111473168,"user":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T12:12:33Z","updated_at":"2015-06-12T12:12:33Z","body":"when you insert ``NaN`` into a column, it is check for compat, then changed to an appropriate dtype if necessary. ``bool`` is a sub-class of ``int`` which is a subclass of ``float``, which supports ``NaN``. You are suggesting for ``bool`` results that they go one step farther to ``object``. I suppose this is possible, maybe even desirable. However, this would have to be checked for in this (in the ``BoolBlock`` in internals). If you'd like to take a crack at this would be great."}}