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

add median(f, itr) method? #27

Closed
ssfrr opened this issue Mar 1, 2020 · 1 comment · Fixed by #186
Closed

add median(f, itr) method? #27

ssfrr opened this issue Mar 1, 2020 · 1 comment · Fixed by #186

Comments

@ssfrr
Copy link

ssfrr commented Mar 1, 2020

Most of the basic statistics e.g. minimum, maximum, and mean, functions can take a function as the first argument, but median doesn't seem to have such a method. Would it be good to add one, for consistency?

This is similar to JuliaLang/Statistics.jl#26 about adding the by keyword, except that by only affects how the elements are ordered and selected, rather than actually transforming the array.

It might be as simple as median(f, x) = median!(f.(x)), though probably needs some type restrictions to play nicely with the other methods.

@fredrikekre fredrikekre transferred this issue from JuliaLang/julia Mar 1, 2020
@ajinkya-k
Copy link
Contributor

Would be fixed by #186. Also related to #141

nalimilan pushed a commit that referenced this issue Feb 5, 2025
…gument (#186)

Adds `quantile(f, v)` and `median(f, v)` methods, where `f` is a function,
and `v` is an abstract array.
Fixes #141, #27.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants