-
Notifications
You must be signed in to change notification settings - Fork 370
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
missing vs nothing #1854
Comments
I noticed that replacing
maybe doc should provide such a DataFrame example (with values as |
Having |
How about: tryparsem(T, str) = something(tryparse(T, str), missing)
df.A = tryparsem.(df.A) |
I didn't know |
I think the reason it isn't included is because of how simple it is. As long as you're aware of the |
@scls19fr - can this be closed given the solution given by @quinnj? |
I'm still wondering what should be done here and I definitely think that closing this simply is not the best action. At least, the doc should be improved to provide this idea. But I still don't know why we couldn't / shouldn't add such a function (even if it's so simple). By providing such a function in Base or in DataFrame it will urge developer to use same function name which is (imho) a good practice to improve code readability. |
I am asking, because this functionality is not DataFrames.jl related. It should live in Base or Missings.jl (probably you can first discuss it in Missings.jl, as this is a place where experimental |
Ok it seems you opened a quite similar issue JuliaData/Missings.jl#61 |
Yes - but we were not sure what was the best way to do it 😞. |
Hello,
After asking on SO https://stackoverflow.com/questions/56684447/convert-a-julia-dataframe-column-with-string-to-one-with-int-and-missing-values/56685891?noredirect=1#comment99940131_56685891 I think this should in fact be discussed here.
I need to convert the following
DataFrame
which looks like
I would like to convert A column from
Array{String,1}
to array ofInt
with missing values.I tried
but I'm getting A column with elements of type
Union{Nothing, Int64}
.nothing
(of typeNothing
) andmissing
(of typeMissing
) seems to be 2 differents kind of values.After asking on SO, it seems that a solution could be
Despite it perfectly answered my question I don't think that's what we can expect from DataFrames users to do so.
Maybe we should have a function which could replace
nothing
bymissing
or maybe another approach could be to have an other definition fortryparse
function (which could outputmissing
).What is you opinion?
Kind regards
The text was updated successfully, but these errors were encountered: