-
Notifications
You must be signed in to change notification settings - Fork 194
sem
does not accept iterables
#342
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
Comments
I think this problem is quite general, we often require arrays of |
I hadn't thought about it, but after #280 things don't work even with julia> sem(@data [1,2,3])
ERROR: MethodError: no method matching sem(::DataArrays.DataArray{Int64,1})
Closest candidates are:
sem(::AbstractArray{#s26,N} where N where #s26<:Real) at /home/pietro/.julia/v0.6/StatsBase/src/scalarstats.jl:237 EDIT: I had added an extra comment with a proposal but I've just realized it was a bad idea. I'll see if I can come up with a list of functions whose signature is too strict in the next few days. |
I've tried going through scalarstats.jl to see how many functions could widen their signature (to work with
Maybe the easiest is to start by widening the signatures for case 1? |
Thanks for checking. Indeed we can already widen the signatures where possible, it won't hurt. Then for 2) it looks like it wouldn't be too hard to stop relying on For 3), calling (BTW, I've realized the various mean functions should promote the element type before computing the sum, to avoid overflows with small types. That's also the case in Base, see JuliaLang/julia#25739.) |
overlap with #449 |
The typing of
sem
may be too strict:Could we simply relax the definition here and allow it to accept anything?
The text was updated successfully, but these errors were encountered: