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

Support missing values #19

Closed
haberdashPI opened this issue Nov 5, 2019 · 3 comments · Fixed by #24
Closed

Support missing values #19

haberdashPI opened this issue Nov 5, 2019 · 3 comments · Fixed by #24

Comments

@haberdashPI
Copy link

This does not seem to work:

PaddedView(missing,rand(10,2))

Would be useful for computing various statistics, over an iterator of arrays, where I want to skip missing values if they fall outside the range of an individual array.

@johnnychen94
Copy link
Member

This is actually supported, note that rand(10, 2) returns Array{Float64, 2}, which doesn't accept missing values.

julia> x = Any[1 2 3;4 5 6]
2×3 Array{Any,2}:
 1  2  3
 4  5  6

julia> PaddedView(missing, x, (-3:3, -3:3))
7×7 PaddedView(missing, ::Array{Any,2}, (-3:3, -3:3)) with eltype Any with indices -3:3×-3:3:
 missing  missing  missing  missing   missing   missing   missing
 missing  missing  missing  missing   missing   missing   missing
 missing  missing  missing  missing   missing   missing   missing
 missing  missing  missing  missing   missing   missing   missing
 missing  missing  missing  missing  1         2         3
 missing  missing  missing  missing  4         5         6
 missing  missing  missing  missing   missing   missing   missing

@haberdashPI
Copy link
Author

Right, but padded view could be smart enough to change the eltype to Union{Missing,Float64} even if the underlying array has an eltype of Float64.

@timholy
Copy link
Member

timholy commented Mar 7, 2020

Want to try a PR, @haberdashPI?

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

Successfully merging a pull request may close this issue.

3 participants