I conldn't find excel "vlookup" equivalent function in DataFrame package 

So I made one myself 


function vlookup(a::Any, df::DataFrame, lookup_col::String, 
find_col::String)

    b = findfirst(df[symbol(lookup_col)], a)
    b != 0 ? c = df[b, symbol(find_col)] : c = 0
    return c

end

And somehow It dosen't feel right to me

Is there any better way to do this?

Reply via email to