Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- load antonio.join["Algeria"] as L
- load antonio.join["Sheet1"] as R
- # nodeType=join
- # name=Join
- # description=Combine two Data Tables into one using a specified column(s) as a key and applying one of four different join types.
- # operation=inner
- u_mask = ~Find(L.preamble.rows[0], "Country")
- v_mask = ~Find(R.preamble.rows[0], "Country")
- yield "Country", L.preamble.rows[0][u_mask], R.preamble.rows[0][v_mask], L.columnHeaders.body.rows[0], R.columnHeaders.body.rows[0]
- index L by "Country"
- index R by "Country"
- for key in Intersection(L, R):
- U = L[key]
- V = R[key]
- for u_row, v_row in Product(U.rows, V.rows):
- u_key = Slice(u_row, 0, 2)
- u_dat = Slice(u_row, 2, NULL)
- v_key = Slice(v_row, 0, 3)
- v_dat = Slice(v_row, 3, NULL)
- yield key, u_key[u_mask], v_key[v_mask], u_dat, v_dat
- layout 1, 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement