We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
using DataFrames ids = [1,5,7,8,9] a = DataFrame(A=1:3, B=4:6) @. a.B = ifelse(a.A ∉ ids, 0, a.B)
using DataFrames ids = [1,5,7,8,9] a = DataFrame(A=1:3, B=4:6) @. a.B = ifelse(a.A ∉ Ref(ids), 0, a.B)
Both will raise DimensionMismatch issue.
The text was updated successfully, but these errors were encountered:
This is unrelated with DataFrames.jl. Use this instead:
julia> a.B .= ifelse.(a.A .∉ Ref(ids), 0, a.B) 3-element Vector{Int64}: 4 0 0
see https://bkamins.github.io/julialang/2023/02/10/in.html for a detailed explanation.
Sorry, something went wrong.
No branches or pull requests
Both will raise DimensionMismatch issue.
The text was updated successfully, but these errors were encountered: