Hello,
I have been selecting the rows of a dataframe with a column Hit
matching a parameter stored in the variable h
with qry = df[df[:Hit] .== h, :]
but now I have switched to Hulia 1.6 and I am getting this error:
julia> qry = df[df[:Hit] .== h, :]
ERROR: ArgumentError: syntax df[column] is not supported use df[!, column] instead
Stacktrace:
[1] getindex(#unused#::DataFrame, #unused#::Symbol)
@ DataFrames ~/.julia/packages/DataFrames/pf2RS/src/abstractdataframe/abstractdataframe.jl:2157
[2] top-level scope
@ none:1
I tried with:
julia> qry = df[!, Hit .== h, :]
ERROR: UndefVarError: Hit not defined
Stacktrace:
[1] top-level scope
@ none:1
julia> qry = df[!, :Hit .== h, :]
ERROR: MethodError: no method matching getindex(::DataFrame, ::typeof(!), ::Bool, ::Colon)
Closest candidates are:
getindex(::DataFrame, ::typeof(!), ::Union{Colon, Regex, AbstractVector{T} where T, All, Between, Cols, InvertedIndex}) at /home/gigiux/.julia/packages/DataFrames/pf2RS/src/dataframe/dataframe.jl:587
getindex(::DataFrame, ::typeof(!), ::Union{AbstractString, Symbol}) at /home/gigiux/.julia/packages/DataFrames/pf2RS/src/dataframe/dataframe.jl:507
getindex(::DataFrame, ::typeof(!), ::Union{Signed, Unsigned}) at /home/gigiux/.julia/packages/DataFrames/pf2RS/src/dataframe/dataframe.jl:499
...
Stacktrace:
[1] top-level scope
@ none:1
julia> qry = df[!, :Hit .== h]
ERROR: MethodError: no method matching getindex(::DataFrame, ::typeof(!), ::Bool)
Closest candidates are:
getindex(::DataFrame, ::typeof(!), ::Union{Colon, Regex, AbstractVector{T} where T, All, Between, Cols, InvertedIndex}) at /home/gigiux/.julia/packages/DataFrames/pf2RS/src/dataframe/dataframe.jl:587
getindex(::DataFrame, ::typeof(!), ::Union{AbstractString, Symbol}) at /home/gigiux/.julia/packages/DataFrames/pf2RS/src/dataframe/dataframe.jl:507
getindex(::DataFrame, ::typeof(!), ::Union{Signed, Unsigned}) at /home/gigiux/.julia/packages/DataFrames/pf2RS/src/dataframe/dataframe.jl:499
...
Stacktrace:
[1] top-level scope
@ none:1
What is the new syntax for this task?
Thanks