Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

LINQ inner joins and select all in Query.jl

$
0
0

This MWE is supposed to

  1. do an inner join (i.a equals j.c || i.b equals j.e) and
  2. output all the elements of the first df:
df1 = DataFrame(a=[1,2,3], b=[1.,2.,3.])
df2 = DataFrame(c=[2,4,2], d=["John", "Jim","Sally"],e=[1.,1.,3.])

x = @from i in df1 begin
    @join j in df2 on i.a equals j.c || i.b equals j.e
    @select i
    @collect DataFrame
end

println(x)

[1] top-level scope at /home/au/Downloads/scratch.jl:23
ERROR: syntax: "j.e" is not a valid function argument name
Stacktrace:
[1] top-level scope at /home/au/Downloads/scratch.jl:7

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles