Hello, I had some code that used to work but it must have been for a previous version of Julia. I can’t find what I am looking for in the DataFrame docs Getting Started · DataFrames.jl
I want to replace values in an array or DataFrame that are less than 0.5 to 0.0.
QWER = rand(5, 5)
QWER[QWER .>= 0.5] .= 0.0
This gives a 12 element view, everything is set to 0.0.
QWER = [QWER .<= 0.5] .= 0.0
This gives the error
MethodError: Cannot
convert an object of type Float64 to an object of type BitArray{2}
using DataFrames
QWER = DataFrame(QWER)
QWER = [QWER .<= 0.5] .= 0.0
This gives the error
MethodError: Cannot
convert an object of type Float64 to an object of type BitArray{2}
QWER[QWER .>= 0.5] .= 0.0
This gives the error
MethodError: no method matching getindex(::DataFrame, ::DataFrame)
What is the correct way to do this?
#########
Answer edit:
For a DataFrame