{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/19444","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/19444/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/19444/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/19444/events","html_url":"https://github.com/JuliaLang/julia/issues/19444","id":192095462,"number":19444,"title":"median of an empty array is undefined","user":{"login":"bjarthur","id":1538268,"avatar_url":"https://avatars.githubusercontent.com/u/1538268?v=3","gravatar_id":"","url":"https://api.github.com/users/bjarthur","html_url":"https://github.com/bjarthur","followers_url":"https://api.github.com/users/bjarthur/followers","following_url":"https://api.github.com/users/bjarthur/following{/other_user}","gists_url":"https://api.github.com/users/bjarthur/gists{/gist_id}","starred_url":"https://api.github.com/users/bjarthur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjarthur/subscriptions","organizations_url":"https://api.github.com/users/bjarthur/orgs","repos_url":"https://api.github.com/users/bjarthur/repos","events_url":"https://api.github.com/users/bjarthur/events{/privacy}","received_events_url":"https://api.github.com/users/bjarthur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-11-28T19:28:16Z","updated_at":"2016-11-30T21:31:16Z","closed_at":null,"body":"i see the [discussion](https://github.com/JuliaLang/julia/issues/6486) of treating `median` and `mean` identically re. NaN.  has it also been discussed whether they should treat empty arrays identically?  currently they do not:\r\n\r\n```\r\njulia> mean(Float64[])\r\nNaN\r\n\r\njulia> median(Float64[])\r\nERROR: ArgumentError: median of an empty array is undefined, Float64[]\r\n in median!(::Array{Float64,1}) at ./statistics.jl:565\r\n in median(::Array{Float64,1}) at ./statistics.jl:582\r\n```\r\n\r\nreally simple change to make `median` return NaN.  all that has to change is the [first line](https://github.com/JuliaLang/julia/blob/master/base/statistics.jl#L565)."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/264001650","html_url":"https://github.com/JuliaLang/julia/issues/19444#issuecomment-264001650","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/19444","id":264001650,"user":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars.githubusercontent.com/u/2913679?v=3","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T21:31:16Z","updated_at":"2016-11-30T21:31:16Z","body":"Using a Nullable/Result type here would be a major PITA because it would force you to call `get` on the result, when in (I suspect) 99.99% of real applications the array will never be empty.  That's why an exception seems more appropriate."}}
{"actor":{"display_login":"stevengj"}}