Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compute median #202

Closed
BeastyBlacksmith opened this issue Jan 9, 2019 · 4 comments · Fixed by JuliaStats/Statistics.jl#28 or JuliaLang/julia#37950
Closed

Cannot compute median #202

BeastyBlacksmith opened this issue Jan 9, 2019 · 4 comments · Fixed by JuliaStats/Statistics.jl#28 or JuliaLang/julia#37950

Comments

@BeastyBlacksmith
Copy link
Contributor

MWE:

using Statistics
median( [1.2μm,1.4μm,1.8μm] )
ERROR: MethodError: no method matching middle(::Unitful.Quantity{Float64,𝐋,Unitful.FreeUnits{(μm,),𝐋,nothing}})
@cstjean
Copy link
Contributor

cstjean commented Jan 9, 2019

It would be fixed if this line was defined using ::Number instead of ::Real

@BeastyBlacksmith
Copy link
Contributor Author

anyone already tried creating a PR yet?

tlnagy added a commit to tlnagy/Statistics.jl that referenced this issue Mar 3, 2020
this adds support for computing the median of unitful types, see PainterQubits/Unitful.jl#202
tlnagy added a commit to tlnagy/Statistics.jl that referenced this issue Oct 1, 2020
this adds support for computing the median of unitful types, see PainterQubits/Unitful.jl#202
ararslan pushed a commit to JuliaStats/Statistics.jl that referenced this issue Oct 8, 2020
* relax type definition of middle

this adds support for computing the median of unitful types, see PainterQubits/Unitful.jl#202

* updates docs and add tests for middle on non-reals
@tlnagy
Copy link

tlnagy commented Oct 8, 2020

This is fixed by https://github.com/JuliaLang/Statistics.jl/pull/28, which should make it into the next version of Julia (my guess is 1.6.0).

@tlnagy
Copy link

tlnagy commented Oct 13, 2020

The updated Statistics.jl has been merged into Base (JuliaLang/julia#37950) so the next version of Julia shouldn't have this issue (it should make it into the 1.6 release).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants