You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Thanks for the report. Sounds like a bug in DataArrays, which is going to be deprecated. Anyway the recommended syntax is now df[:max] = max.(ab, bc, ac), and AFAICT it works both with 0.8.4 and git master (at least after JuliaStats/NullableArrays.jl#166).
When I try to retrieve the maximums of differences of columns in a DataFrame I get an error. What is wrong?
=> LoadError: MethodError: no method matching isless(::DataArrays.DataArray{Int64,1}, ::Array{Any,1})
Doing the maximum of either
df[:max] = max(ab, bc)
ordf[:max] = max(a, b, c)
works as expected.Can anybody clarify what's going on? Thank you!
The text was updated successfully, but these errors were encountered: