DataFrames.leftjoin now working? leftjoin not defined

julia> using DataFrames

julia> jobs = DataFrame(ID = [20, 60], Job = [“Lawyer”, “Astronaut”])
2×2 DataFrame
│ Row │ ID │ Job │
│ │ Int64 │ String │
├─────┼───────┼───────────┤
│ 1 │ 20 │ Lawyer │
│ 2 │ 60 │ Astronaut │

julia> people = DataFrame(ID = [20, 40], Name = [“John Doe”, “Jane Doe”])
2×2 DataFrame
│ Row │ ID │ Name │
│ │ Int64 │ String │
├─────┼───────┼──────────┤
│ 1 │ 20 │ John Doe │
│ 2 │ 40 │ Jane Doe │

julia> DataFrames.leftjoin(people, jobs, on = :ID)
ERROR: UndefVarError: leftjoin not defined
Stacktrace:
[1] getproperty(::Module, ::Symbol) at .\Base.jl:26
[2] top-level scope at REPL[4]:1
[3] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1088

julia>

What version of DataFrames are you using? Check with ] st

1 Like

I have DataFrames v0.20.2.
I realized that the syntax I was using is for version 0.21.7 – this is where the new leftjoin function is defined. In version 0.20.2 the syntax “join(people, jobs, on = :ID, kind = :left)”

1 Like