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

coalesce example doesn't work #13

Open
lewisl opened this issue Apr 30, 2019 · 1 comment
Open

coalesce example doesn't work #13

lewisl opened this issue Apr 30, 2019 · 1 comment

Comments

@lewisl
Copy link

lewisl commented Apr 30, 2019

coalesce no longer works as you describe. It must returns the first item that is missing. You must perhaps have left out map(...)?

Sadly, I had to do:

df[ismissing.(df.mycol),:mycol] = "" # or whatever substitute value is appropriate.

@bkamins
Copy link
Owner

bkamins commented Apr 30, 2019

Can you please point which entry in the tutorial is incorrect (I have checked it just now and did not find the error you point out).

The operation you indicate is typically done as:

replace!(df.mycol,missing=>"")

if substitute value has the type that is subtype of eltype(df.mycol) or

df.mycol = coalesce.(df.mycol, "")

otherwise (as you have to replace the vector in the DataFrame by a new vector).

I will update the tutorial to make it more explicit.

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