Advertisement
raba93

Untitled

Oct 21st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. load antonio.transform["Filter_Sample"] as M
  2. # nodeType=transform
  3. # name=test
  4. # description=Transform values
  5. yield "drzava","IGO","Sum of all years","2x 1961","1961 to 1962 ratio","larger of 1961 and 1962"
  6. f1 = Transform("r[0]", "r")
  7. f2 = Transform("Sum(Slice(r, 1, NULL))", "r")
  8. f3 = Transform("Mul(2, r[19])", "r")
  9. f4 = Transform("(Div(r[19], r[20])) if (r[20] != 0) else (NULL)", "r")
  10. f5 = Transform("(r[19]) if (r[19] > r[20]) else (r[20])", "r")
  11. for row in M.rows:
  12.     c0 = Slice(row, 0, 1)
  13.     c1 = f1(row)
  14.     c2 = f2(row)
  15.     c3 = f3(row)
  16.     c4 = f4(row)
  17.     c5 = f5(row)
  18.     yield c0, c1, c2, c3, c4, c5
  19. layout 1, 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement