{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/13806","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/13806/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/13806/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/13806/events","html_url":"https://github.com/pydata/pandas/issues/13806","id":167679766,"number":13806,"title":"\"Or\" does not have commutative property (possibly because it catches exceptions silently?)","user":{"login":"josepablog","id":1832193,"avatar_url":"https://avatars.githubusercontent.com/u/1832193?v=3","gravatar_id":"","url":"https://api.github.com/users/josepablog","html_url":"https://github.com/josepablog","followers_url":"https://api.github.com/users/josepablog/followers","following_url":"https://api.github.com/users/josepablog/following{/other_user}","gists_url":"https://api.github.com/users/josepablog/gists{/gist_id}","starred_url":"https://api.github.com/users/josepablog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josepablog/subscriptions","organizations_url":"https://api.github.com/users/josepablog/orgs","repos_url":"https://api.github.com/users/josepablog/repos","events_url":"https://api.github.com/users/josepablog/events{/privacy}","received_events_url":"https://api.github.com/users/josepablog/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Missing-data","name":"Missing-data","color":"d7e102"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Strings","name":"Strings","color":"5319e7"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Usage%20Question","name":"Usage Question","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-07-26T18:37:57Z","updated_at":"2016-07-27T11:23:38Z","closed_at":null,"body":"#### Code Sample, a copy-pastable example if possible\r\nimport pandas as pd\r\n\r\n```\r\n#Create sample dataframe\r\ntest = pd.DataFrame({\"a\":[\"12\", float(\"nan\"), \"3\", \"meow\" ]})\r\n\r\n# Select rows that are null or numeric:\r\nprint len(test[ test[\"a\"].isnull() | test[\"a\"].str.isnumeric()])\r\n\r\n# Select rows that are numeric or null\r\nprint len(test[ test[\"a\"].str.isnumeric() | test[\"a\"].isnull() ])\r\n\r\n# These two should return the same result, right? Unfortunately they don't\r\n```\r\nNotice that `Series.str.isnumeric` throws an exception on null entries. However, I believe that this may introduce bugs silently\r\n\r\n\r\n#### Expected Output\r\nExpected output is:\r\n2\r\n2\r\n\r\nInstead, I get:\r\n3\r\n2\r\n\r\n#### output of ``pd.show_versions()``\r\nINSTALLED VERSIONS\r\n------------------\r\ncommit: None\r\npython: 2.7.12.final.0\r\npython-bits: 64\r\nOS: Darwin\r\nOS-release: 15.6.0\r\nmachine: x86_64\r\nprocessor: i386\r\nbyteorder: little\r\nLC_ALL: None\r\nLANG: None\r\n\r\npandas: 0.18.1\r\n"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/235558036","html_url":"https://github.com/pydata/pandas/issues/13806#issuecomment-235558036","issue_url":"https://api.github.com/repos/pydata/pandas/issues/13806","id":235558036,"user":{"login":"jorisvandenbossche","id":1020496,"avatar_url":"https://avatars.githubusercontent.com/u/1020496?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T11:23:37Z","updated_at":"2016-07-27T11:23:37Z","body":"This boils down to the Series behaviour for `|` with Nans:\r\n\r\n```\r\nIn [10]: pd.Series([True, np.nan]) | pd.Series([False, True])\r\nOut[10]:\r\n0     True\r\n1    False\r\ndtype: bool\r\n\r\nIn [11]: pd.Series([False, True]) | pd.Series([True, np.nan])\r\nOut[11]:\r\n0    True\r\n1    True\r\ndtype: bool\r\n```\r\n\r\nSo the comparison never propagates the `NaN`. For this reason, you do not get any exception. \r\nBut, the difference between both is a bit surprising.\r\n"}}
{"actor":{"display_login":"jorisvandenbossche"}}