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 varm handling for Missing #62

Open
bkamins opened this issue Dec 2, 2017 · 3 comments
Open

add varm handling for Missing #62

bkamins opened this issue Dec 2, 2017 · 3 comments

Comments

@bkamins
Copy link
Member

bkamins commented Dec 2, 2017

Now std([1, 2, missing]) fails, because varm requires that the second argument is <:Number. As this is a basic functionality in Base I think it would be good to add a custom method handling Missing in Missings.jl.

There are similar failures in many functions in StatsBase, but I guess that this should be handled elswhere? Yes?.

@nalimilan
Copy link
Member

You're supposed to do std(skipmissing([1, 2, missing])) in that case. That's documented in the README and in the DataFrames manual, hopefully once Missing is added to Base we'll add a section in the manual about it.

It would make sense to have std accept any AbstractArray{<:Union{Number, Missing}}) input, and return missing if there's a missing value, but that will only be workable with Missing defined in Base: else we would have to duplicate all math functions taking arrays.

@bkamins
Copy link
Member Author

bkamins commented Dec 2, 2017

Thank you for the answer.

It would make sense to have std accept any AbstractArray{<:Union{Number, Missing}}) input, and return missing if there's a missing value

This is exactly what I have meant (I know skipmissing, but it is a different use case).

Close this issue then?

@nalimilan
Copy link
Member

I guess we can keep it open as a reminder of what needs to be done in Base.

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

No branches or pull requests

2 participants