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

No isnull for arrays? #16112

Closed
tlnagy opened this issue Apr 29, 2016 · 7 comments
Closed

No isnull for arrays? #16112

tlnagy opened this issue Apr 29, 2016 · 7 comments

Comments

@tlnagy
Copy link
Contributor

tlnagy commented Apr 29, 2016

Base doesn't have any way of checking which positions in an array have valid values.

a = Nullable{Float64}[]
for i in 1:10
    push!(a, Nullable{Float64}())
end
a[1] = 2.0
isnull(a)

while the following works

map(x -> isnull(x), a)
@johnmyleswhite
Copy link
Member

What do you envision isnull(a) meaning?

@tlnagy
Copy link
Contributor Author

tlnagy commented Apr 29, 2016

Returning a boolean array with the values that are null. Something
similar to how isna already operates.

On Thu, Apr 28, 2016, at 17:56, John Myles White wrote:

What do you envision isnull(a) meaning?

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub[1]

Links:

  1. No isnull for arrays? #16112 (comment)

@johnmyleswhite
Copy link
Member

So it would be vectorized. I think that's not the best path forward for two reasons:

  • We want to remove vectorized functions, not add more of them.
  • It's actually very reasonable to imagine that isnull(a) should return a Boolean.

@andreasnoack
Copy link
Member

map(isnull, a)

@tlnagy
Copy link
Contributor Author

tlnagy commented Apr 29, 2016

Thanks everyone for weighing in. I guess with #13412 merged, using an anonymous function will be plenty fast.

@tlnagy tlnagy closed this as completed Apr 29, 2016
@nalimilan
Copy link
Member

@tlnagy As @andreasnoack said, you don't need an anonymous function at all, so it's already fast in 0.4. Also, with the syntax proposed at #8450, you might be able to write it as isnull.(a) at some point.

@tlnagy
Copy link
Contributor Author

tlnagy commented Apr 29, 2016

@nalimilan Good catch. I thought that used an anonymous function internally, but now I realize that doesn't make too much sense. Thanks!

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

4 participants