When I try to retrieve the maximums of differences of columns in a DataFrame I get an error. What is wrong?
using DataFrames
a = [2,4,10,4,8,8]
b = [5,9,7,2,8,7]
c = [2,9,7,6,8,1]
df = DataFrame(A = a, B = b, C = c)
df[2,:A] = NA
df[3,:C] = NA
ab=df[:A] - df[:B]
bc=df[:B] - df[:C]
ac=df[:A] - df[:C]
df[:max] = max(ab, bc, ac)
println(df)
=> LoadError: MethodError: no method matching isless(::DataArrays.DataArray{Int64,1}, ::Array{Any,1})
Doing the maximum of either df[:max] = max(ab, bc)
or df[:max] = max(a, b, c)
works as expected.
Can anybody clarify what's going on? Thank you!