dataframejuliaijulia-notebook

"Not" not defined while using Julia DataFrames


While going through the tutorials of DataFrames from MLJ, I encountered the following error

julia> b2 = select(boston, Not(:NOx))
ERROR: UndefVarError: Not not defined
Stacktrace:
 [1] top-level scope at none:0

Link to the tutorial: https://alan-turing-institute.github.io/DataScienceTutorials.jl/data/dataframe/


Solution

  • This operation should work:

    julia> b2 = select(boston, Not(:NOx))
    506×13 DataFrame
     Row │ Crim     Zn       Indus    Chas   Rm       A ⋯
         │ Float64  Float64  Float64  Int64  Float64  F ⋯
    ─────┼───────────────────────────────────────────────
       1 │ 0.00632     18.0     2.31      0    6.575  6 ⋯
       2 │ 0.02731      0.0     7.07      0    6.421  7
       3 │ 0.02729      0.0     7.07      0    7.185  6
      ⋮  │    ⋮        ⋮        ⋮       ⋮       ⋮       ⋱
     504 │ 0.06076      0.0    11.93      0    6.976  9
     505 │ 0.10959      0.0    11.93      0    6.794  8 ⋯
     506 │ 0.04741      0.0    11.93      0    6.03   8
                           8 columns and 500 rows omitted
    

    Please make sure that you are using the latest DataFrames.jl version. Go to package manager mode by pressing ] in the Julia REPL and then write:

    (@v1.6) pkg> st DataFrames
          Status `~/.julia/environments/v1.6/Project.toml`
      [a93c6f00] DataFrames v0.22.5
    

    Your version number should be 0.22.5 (as of time of this writing).

    If it is some older version you probably have some other package that restricts updating of DataFrames.jl. Here is a post describing how to diagnose such situations.