Skip to content

Add init kwarg to mean/median to match other reductions in Base #105

Open
@non-Jedi

Description

@non-Jedi

The absence of an init kwarg like is available with reduce and sum makes mean compose less well with e.g. skipmissing. I'm finding myself using let y=collect(skipmissing(x)); isempty(y) ? missing : mean(y) end when I should be able to just say mean(skipmissing(x); init=missing).

There may be other reductions than mean and median in Statistics.jl that also should have init added, but those are the two I've needed (median isn't quite a reduction technically, but it's close enough that an init kwarg would be useful).

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