Advertisement
raba93

Untitled

Oct 6th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. load antonio.join["Algeria"] as L
  2. load antonio.join["Sheet1"] as R
  3. # nodeType=join
  4. # name=Join
  5. # description=Combine two Data Tables into one using a specified column(s) as a key and applying one of four different join types.
  6. # operation=inner
  7. u_mask = ~Find(L.preamble.rows[0], "Country")
  8. v_mask = ~Find(R.preamble.rows[0], "Country")
  9. yield "Country", L.preamble.rows[0][u_mask], R.preamble.rows[0][v_mask], L.columnHeaders.body.rows[0], R.columnHeaders.body.rows[0]
  10. index L by "Country"
  11. index R by "Country"
  12. for key in Intersection(L, R):
  13. U = L[key]
  14. V = R[key]
  15. for u_row, v_row in Product(U.rows, V.rows):
  16. u_key = Slice(u_row, 0, 2)
  17. u_dat = Slice(u_row, 2, NULL)
  18. v_key = Slice(v_row, 0, 3)
  19. v_dat = Slice(v_row, 3, NULL)
  20. yield key, u_key[u_mask], v_key[v_mask], u_dat, v_dat
  21. layout 1, 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement