Re: [julia-users] Indexing DataFrames

2014-05-16 Thread Jason Solack
perfect, thank you! On Friday, May 16, 2014 11:28:46 AM UTC-4, John Myles White wrote: > > This is a result of the weird precedence of &. Try this: > > (df[:A] .== 1) & (df[:B] .== 1) > > — John > > On May 16, 2014, at 8:25 AM, Jason Solack > > wrote: > > > Hello all > > > > I'm trying to

Re: [julia-users] Indexing DataFrames

2014-05-16 Thread John Myles White
This is a result of the weird precedence of &. Try this: (df[:A] .== 1) & (df[:B] .== 1) — John On May 16, 2014, at 8:25 AM, Jason Solack wrote: > Hello all > > I'm trying to index a dataframe in the folowing manner: > > df = DataFrame(A = round(rand(1000) * 10), B = round(rand(1000) * 10))

[julia-users] Indexing DataFrames

2014-05-16 Thread Jason Solack
Hello all I'm trying to index a dataframe in the folowing manner: df = DataFrame(A = round(rand(1000) * 10), B = round(rand(1000) * 10)) df[:C] = 0 df[(df[:A] .== 1 & df[:B] .== 1),: C] = 1 I get an error "ERROR: no method &(Int64, DataArray{Float64, 1}) if i index like this, it works but i wo