{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/10709","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/10709/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/10709/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/10709/events","html_url":"https://github.com/numpy/numpy/issues/10709","id":303566960,"number":10709,"title":"Control \"Mean of empty slice\" RunTimeWarning with np.errstate","user":{"login":"JonathanShor","id":11262246,"avatar_url":"https://avatars2.githubusercontent.com/u/11262246?v=4","gravatar_id":"","url":"https://api.github.com/users/JonathanShor","html_url":"https://github.com/JonathanShor","followers_url":"https://api.github.com/users/JonathanShor/followers","following_url":"https://api.github.com/users/JonathanShor/following{/other_user}","gists_url":"https://api.github.com/users/JonathanShor/gists{/gist_id}","starred_url":"https://api.github.com/users/JonathanShor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonathanShor/subscriptions","organizations_url":"https://api.github.com/users/JonathanShor/orgs","repos_url":"https://api.github.com/users/JonathanShor/repos","events_url":"https://api.github.com/users/JonathanShor/events{/privacy}","received_events_url":"https://api.github.com/users/JonathanShor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-08T17:35:00Z","updated_at":"2018-03-09T03:34:18Z","closed_at":null,"author_association":"NONE","body":"As there already exists a mechanism in numpy to manage warnings for possibly anomalous inputs, it seems odd that it doesn't work for all warnings. For example, `nanmean` raises a warning if given a slice of all nan, and apparently the only way to silence it is to catch it with the python warnings mechanism. `np.errstate`, despite claiming to handle divide by zero errors, does not:\r\n\r\n```\r\nPython 3.6.2 \r\nIn [1]: import numpy as np\r\nIn [2]: np.__version__\r\nOut[2]: '1.13.1'\r\n\r\nIn [3]: allnan = np.array([np.nan, np.nan])\r\nIn [4]: with np.errstate(divide='ignore', invalid='ignore'):\r\n   ...:     print(np.nanmean(allnan))\r\n   ...:     \r\n/Users/jonathanshor/anaconda2/envs/Python3/bin/ipython:2: RuntimeWarning: Mean of empty slice\r\n  if __name__ == '__main__':\r\nnan\r\n```\r\n\r\nI would suggest this could fall under the divide case, but invalid seems plausible as well."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/371703240","html_url":"https://github.com/numpy/numpy/issues/10709#issuecomment-371703240","issue_url":"https://api.github.com/repos/numpy/numpy/issues/10709","id":371703240,"user":{"login":"rkern","id":46135,"avatar_url":"https://avatars3.githubusercontent.com/u/46135?v=4","gravatar_id":"","url":"https://api.github.com/users/rkern","html_url":"https://github.com/rkern","followers_url":"https://api.github.com/users/rkern/followers","following_url":"https://api.github.com/users/rkern/following{/other_user}","gists_url":"https://api.github.com/users/rkern/gists{/gist_id}","starred_url":"https://api.github.com/users/rkern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkern/subscriptions","organizations_url":"https://api.github.com/users/rkern/orgs","repos_url":"https://api.github.com/users/rkern/repos","events_url":"https://api.github.com/users/rkern/events{/privacy}","received_events_url":"https://api.github.com/users/rkern/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T03:34:18Z","updated_at":"2018-03-09T03:34:18Z","author_association":"MEMBER","body":"Since the consensus that we've reached on the action to take is different from the title and the initial discussion, it would probably be better to close this issue and start a fresh one with the consensus request. You're more likely to get volunteer effort that way."}}
{"actor":{"display_login":"rkern"}}