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

Error in Missings.replace #110

Closed
pstaabp opened this issue Oct 30, 2019 · 1 comment
Closed

Error in Missings.replace #110

pstaabp opened this issue Oct 30, 2019 · 1 comment

Comments

@pstaabp
Copy link

pstaabp commented Oct 30, 2019

If I create a DataFrame, like

df = DataFrame(a=[1,missing,3],b=[1.0,2.0,missing])

and then try to replace the missing values with zero using:

collect(Missings.replace(df,0.0))

I get the following error:

┌ Warning: `length(df::AbstractDataFrame)` is deprecated, use `size(df, 2)` instead.
│   caller = length at Missings.jl:86 [inlined]
└ @ Core /Users/pstaab/.julia/packages/Missings/Aam9N/src/Missings.jl:86

It seems that when the DataFrames package deprecated some functions, this package didn't get updated.

@nalimilan
Copy link
Member

Missings.replace only works on iterables, which DataFrame isn't. Try coalesce.(df, 0.0).

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