leftjoin(df_A,df_B, on = :Date) UndefVarError: leftjoin not defined

My once functioning code, which uses DataFrames, suddenly throws an error at the line

 leftjoin(df_A,df_B, on = :Date) 

I have no idea why leftjoin is suddenly not recognized. What am I missing?

For starters you are missing to share in your post your environment, all the relevant pre-formatted code and the error you have so that people can help you.

1 Like

check version?

julia> using DataFrames

julia> leftjoin
leftjoin (generic function with 1 method)
1 Like

I restarted Atom, typed exactly what jling asked, and got the error shown in the image after Julia started:

Check the version of DataFrames you are using:

using Pkg
Pkg.status(“DataFrames”)

In older versions, there was just join and you would specify the type of join.

1 Like

DataFrames v0.20.2

Re-started my PC. Same problem. I have no idea what to do next. Perhaps I can try removing the latest version of DataFrames and then install a prior version? Or perhaps I have an old version?

You have an old version. DataFrames is now on version 1.2.

Old documentation of DataFrames is here. But you should really update to the latest version. It has stability guarantees, so after upgrading you won’t run into an error like this again.

This is very strange. My code was working. Then suddenly it is not. The image shows what I get when I try to install the latest version.

Between the code working and not working, I installed PlotlyJS. Can that be an influence? I have removed that now, by the way. But the “Unsatisfiable” requirements remain…

Hmm it’s hard to debug.

That is a pretty clear error message though. Lathe doesn’t allow a high enough version of DataFrames.

It looks like your DataFrames.jl version may have gotten downgraded as a result of adding PlotlyJS, but that shouldn’t result in a breaking change like leftjoin no longer being defined.

Any advice? Re-Install Atom? Something that drastic?

Do you have access to a Project.toml before and after things started breaking?

Not sure. Apologies from a newbie.

I would guess that you had DataFrames 0.21.0 before adding PlotlyJS, then it downgraded. But I have no idea why that would have happened.

True ]add DataFrames@0.21.0 and see what happens. Then remove PlotlyJS and try again and see what happens.

I removed Lathe, installed the latest version of DataFrames, and now things work. Of course, now I don’t have Lathe. But for my immediate plans this is still progress!

To be honest, I would try and switch over to a more mature machine learning framework. It’s a bad sign that Lathe.jl doesn’t allow for more recent versions of DataFrames.jl. It is also written in a weird object-oriented style. Maybe try MLJ?

4 Likes

FYI, you can create new environments in Julia where you install the packages you need and avoid these types of versioning issues.