{"action":"created","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/6660","repository_url":"https://api.github.com/repos/scipy/scipy","labels_url":"https://api.github.com/repos/scipy/scipy/issues/6660/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/6660/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/6660/events","html_url":"https://github.com/scipy/scipy/issues/6660","id":181829809,"number":6660,"title":"mode asks for 'ignore' in error, but wants 'omit'","user":{"login":"Gijs-Koot","id":4848325,"avatar_url":"https://avatars.githubusercontent.com/u/4848325?v=3","gravatar_id":"","url":"https://api.github.com/users/Gijs-Koot","html_url":"https://github.com/Gijs-Koot","followers_url":"https://api.github.com/users/Gijs-Koot/followers","following_url":"https://api.github.com/users/Gijs-Koot/following{/other_user}","gists_url":"https://api.github.com/users/Gijs-Koot/gists{/gist_id}","starred_url":"https://api.github.com/users/Gijs-Koot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gijs-Koot/subscriptions","organizations_url":"https://api.github.com/users/Gijs-Koot/orgs","repos_url":"https://api.github.com/users/Gijs-Koot/repos","events_url":"https://api.github.com/users/Gijs-Koot/events{/privacy}","received_events_url":"https://api.github.com/users/Gijs-Koot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-08T14:44:44Z","updated_at":"2016-10-08T15:00:53Z","closed_at":null,"body":"In\r\n\r\n    >> scipy.stats.mode(np.array([2, 3, np.nan]), nan_policy='ignore')\r\n\r\nOut\r\n\r\n    >> ---------------------------------------------------------------------------\r\n    ValueError                                Traceback (most recent call last)\r\n    <ipython-input-147-a841bca3e462> in <module>()\r\n    ----> 1 mode(np.array([2, 3, np.nan]), nan_policy='ignore')\r\n\r\n    /home/gijs/anaconda3/lib/python3.5/site-packages/scipy/stats/stats.py in mode(a, axis, nan_policy)\r\n    636         return np.array([]), np.array([])\r\n    637 \r\n    --> 638     contains_nan, nan_policy = _contains_nan(a, nan_policy)\r\n    639 \r\n    640     if contains_nan and nan_policy == 'omit':\r\n\r\n    /home/gijs/anaconda3/lib/python3.5/site-packages/scipy/stats/stats.py in _contains_nan(a, nan_policy)\r\n    241 def _contains_nan(a, nan_policy='propagate'):\r\n    242     if nan_policy not in ('propagate', 'raise', 'omit'):\r\n    --> 243         raise ValueError(\"nan_policy must be either 'propagate', 'raise', or \"\r\n    244                          \"'ignore'\")\r\n    245     try:\r\n\r\n    ValueError: nan_policy must be either 'propagate', 'raise', or 'ignore'\r\n\r\nVersion\r\n\r\n    scipy.__version__\r\n    '0.17.1'\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/scipy/scipy/issues/comments/252429117","html_url":"https://github.com/scipy/scipy/issues/6660#issuecomment-252429117","issue_url":"https://api.github.com/repos/scipy/scipy/issues/6660","id":252429117,"user":{"login":"person142","id":15134881,"avatar_url":"https://avatars.githubusercontent.com/u/15134881?v=3","gravatar_id":"","url":"https://api.github.com/users/person142","html_url":"https://github.com/person142","followers_url":"https://api.github.com/users/person142/followers","following_url":"https://api.github.com/users/person142/following{/other_user}","gists_url":"https://api.github.com/users/person142/gists{/gist_id}","starred_url":"https://api.github.com/users/person142/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/person142/subscriptions","organizations_url":"https://api.github.com/users/person142/orgs","repos_url":"https://api.github.com/users/person142/repos","events_url":"https://api.github.com/users/person142/events{/privacy}","received_events_url":"https://api.github.com/users/person142/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T15:00:53Z","updated_at":"2016-10-08T15:00:53Z","body":"Looks fixed in master:\r\n\r\n``` python\r\n>>> from scipy import stats\r\n>>> import numpy as np\r\n>>> stats.mode(np.array([2, 3, np.nan]), nan_policy='ignore')\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/Users/Josh/Projects/scipy-dev/python3/scipy/scipy/stats/stats.py\", line 424, in mode\r\n    contains_nan, nan_policy = _contains_nan(a, nan_policy)\r\n  File \"/Users/Josh/Projects/scipy-dev/python3/scipy/scipy/stats/stats.py\", line 237, in _contains_nan\r\n    ', '.join(\"'%s'\" % s for s in policies))\r\nValueError: nan_policy must be one of {'propagate', 'raise', 'omit'}\r\n>>> import scipy\r\n>>> scipy.__version__\r\n'0.19.0.dev0+91f74c9'\r\n```"}}
{"actor":{"display_login":"person142"}}