Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. # Original data
  2. # (Creditor, Debtor, Amount)
  3. (James, Mary, 1300)
  4. (Mary, Robert, 2500)
  5. (Mary, Michael, 500)
  6. (Barbara, Linda, 1200)
  7. (Linda, Robert, 300)
  8.  
  9. # Mapped to two individual records
  10. # (Person, Amount)
  11. (James, 1300)
  12. (Mary, -1300)
  13. (Mary, 2500)
  14. (Robert, -2500)
  15. (Mary, 500)
  16. (Michael, -500)
  17. (Barbara, 1200)
  18. (Linda, -1200)
  19. (Linda, 300)
  20. (Robert, -300)
  21.  
  22. # Reduced by person
  23. # (Person, Balance)
  24. (James, 1300) # 1300
  25. (Mary, 1700) # -1300 + 2500 + 500
  26. (Robert, -2800) # -2500 + -300
  27. (Michael, -500) # -500
  28. (Barbara, 1200) # 1200
  29. (Linda, 900) # -1200 + 300
  30.  
  31. # Mapped to buckets
  32. # (Bucket, Constant 1)
  33. (1, 1) # James
  34. (1, 1) # Mary
  35. (-3, 1) # Robert
  36. (-1, 1) # Michael
  37. (1, 1) # Barbara
  38. (0, 1) # Linda
  39.  
  40. # Reduced by bucket
  41. # (Bucket, # of People)
  42. (1, 3) # 3 people in range [1000, 2000)
  43. (-3, 1) # 1 person in range [-3000, -2000)
  44. (-1, 1) # 1 person in range [-1000, 0)
  45. (0, 1) # person in range [0, 1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement