Skip to content

sem does not accept iterables #342

Closed
@piever

Description

@piever

The typing of sem may be too strict:

julia> itr = (i for i in 1:3)
Base.Generator{UnitRange{Int64},##3#4}(#3, 1:3)

julia> mean(itr)
2.0

julia> var(itr)
1.0

julia> std(itr)
1.0

julia> sem(itr)
ERROR: MethodError: no method matching sem(::Base.Generator{UnitRange{Int64},##3#4})
Closest candidates are:
  sem(::AbstractArray{#s26,N} where N where #s26<:Real) at /home/pietro/.julia/v0.6/StatsBase/src/scalarstats.jl:237

Could we simply relax the definition here and allow it to accept anything?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions