{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/8133","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/8133/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/8133/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/8133/events","html_url":"https://github.com/numpy/numpy/issues/8133","id":182087640,"number":8133,"title":"np.ma.mean(img) broken for np.float16 type","user":{"login":"user-na","id":19994053,"avatar_url":"https://avatars.githubusercontent.com/u/19994053?v=3","gravatar_id":"","url":"https://api.github.com/users/user-na","html_url":"https://github.com/user-na","followers_url":"https://api.github.com/users/user-na/followers","following_url":"https://api.github.com/users/user-na/following{/other_user}","gists_url":"https://api.github.com/users/user-na/gists{/gist_id}","starred_url":"https://api.github.com/users/user-na/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/user-na/subscriptions","organizations_url":"https://api.github.com/users/user-na/orgs","repos_url":"https://api.github.com/users/user-na/repos","events_url":"https://api.github.com/users/user-na/events{/privacy}","received_events_url":"https://api.github.com/users/user-na/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-10T18:52:45Z","updated_at":"2016-10-10T19:58:49Z","closed_at":null,"body":"I have a 64x64 image filled with uint8 random numbers. ( [TESTimg.zip](https://github.com/numpy/numpy/files/520200/TESTimg.zip) )\r\n\r\nDepending on the dtype, I get slightly different results (as expected):\r\n```\r\nimg = np.fromfile(imagepath, dtype=np.uint8).reshape(64,64).astype(np.uint8)\r\nnp.ma.mean(img)\r\nOut: 126.73388671875\r\n\r\nimg = np.fromfile(imagepath, dtype=np.uint8).reshape(64,64).astype(np.float32)\r\nnp.ma.mean(img)\r\n\r\nOut: 126.73389\r\n```\r\nBut for float 16, things go totally wrong:\r\n```\r\nimg = np.fromfile(imagepath, dtype=np.uint8).reshape(64,64).astype(np.float16)\r\nnp.ma.mean(img)\r\nOut: inf\r\n```\r\n\r\nNumpy Version 1.11.1\r\nPython 2.7\r\n"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/252730516","html_url":"https://github.com/numpy/numpy/issues/8133#issuecomment-252730516","issue_url":"https://api.github.com/repos/numpy/numpy/issues/8133","id":252730516,"user":{"login":"user-na","id":19994053,"avatar_url":"https://avatars.githubusercontent.com/u/19994053?v=3","gravatar_id":"","url":"https://api.github.com/users/user-na","html_url":"https://github.com/user-na","followers_url":"https://api.github.com/users/user-na/followers","following_url":"https://api.github.com/users/user-na/following{/other_user}","gists_url":"https://api.github.com/users/user-na/gists{/gist_id}","starred_url":"https://api.github.com/users/user-na/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/user-na/subscriptions","organizations_url":"https://api.github.com/users/user-na/orgs","repos_url":"https://api.github.com/users/user-na/repos","events_url":"https://api.github.com/users/user-na/events{/privacy}","received_events_url":"https://api.github.com/users/user-na/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T19:58:49Z","updated_at":"2016-10-10T19:58:49Z","body":"With this argumentation, uint8 should deliver an inf result too. But in fact its result is quite accurate.\r\n"}}
{"actor":{"display_login":"user-na"}}