-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Non-propogation, skipmissing
-related improvements to Missing handling.
#35050
Comments
With regards to point 4.
|
No matter what the solution is, I think that a short term fix to the documentation is in order, because right now it's: https://docs.julialang.org/en/v1/manual/missing/#Propagation-of-Missing-Values-1
But there are a lot of standard functions where it's not propagated, and that's purposefully done because of a decision that's blocking PRs. That's fine, but we shouldn't tell users that they will propagate if there is no intent on adding such propagation. Instead, this section should probably be replaced with one that says that
So if the |
For documentation I would just use the higher-order function
instead of a macro. |
Would it be worth adding a type parameter to force specialization on the type of |
E.g. propagate_missing(f::F) where {F} = x -> x === missing ? x : f(x) |
These proposals do not sound very different from the current |
Alright, so should the docs just say functions don't propagate missing and point to using passmissing? |
Yes, but there are still a lot of improvements to |
Just FYI, I think we can and should just make I think just improving vanilla iterator transformations ( |
This should probably have been "when passed to standard mathematical operators and functions". See #35264. (Do note that there's a paragraph not visible in the diff which explicitly says that most functions do not propagate.) |
There is broad consensus that
missing
handling could be improved. Many discussions focus on making propagation ofmissing
s easier, and those discussions are worth having, but I also want to focus on howskipmissing
handling could be improved. Here are my suggestions. There is a lot of overlap with #30596 here but this discussion should focus more on building ideas and a roadmap rather than a specific implementation.Tuple
of iterators. I am working on a PR in Missings.jl to make this work. This will make it easier to work with vectors with mismatched values. This is especially useful for plotting.cor
, accept any iterator and not vectors so we don't need to collectskipmissing
s.skipmissings
above in (1), this returns an iterator of tuples. both are useful.skipmissing
back to a vector with missings in the same locations. It would be nice forskipmissing
to have some kind of persistence so that you don't lose the location ofmissing
s when you collect. This allows you to, say, de-mean (or a more complicated function) elements of a vector with respect to non-missing entries.And it will apply a filter on everything at the start of the function.
These are concrete changes that can be made without using relying on propagation of
missing
s. They would lead to a workflow where one is able to take a vector, filter it to remove missings in whatever way you like, do things with the vector (the hard part), and then keep themissing
s in the correct locations.The text was updated successfully, but these errors were encountered: