I just wanted to check if we can do inner join and fetch result of matching rows by comparing column values of two data frames.
Currently I’ve tried below code and getting error “ArgumentError: All elements of on
argument to join
must be Symbol or Pair{Symbol, Symbol}.”
innerjoin(df2, df1, on = [:DPRT_CD, :timeline => (>=, <=)], makeunique = true)
df2
3×5 DataFrame
Row │ c d DPRT_TML DPRT_CD timeline
│ Int64 String Int64 String Int64
─────┼────────────────────────────────────────────────────
1 │ 1 f 786 ABC 50
2 │ 2 g 846 DEF 50
3 │ 3 h 915 ABC 50
df1
5×5 DataFrame
Row │ DPRT_CD timeID timeStart timeEnd timeline
│ String Int64 Int64 Int64 Int64
─────┼───────────────────────────────────────────────────────────────
1 │ ABC 1 0 59 50
2 │ ABC 2 60 119 50
3 │ ABC 3 120 179 50
4 │ ABC 4 180 239 50
5 │ ABC 5 240 299 50