Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Original data
- # (Creditor, Debtor, Amount)
- (James, Mary, 1300)
- (Mary, Robert, 2500)
- (Mary, Michael, 500)
- (Barbara, Linda, 1200)
- (Linda, Robert, 300)
- # Mapped to two individual records
- # (Person, Amount)
- (James, 1300)
- (Mary, -1300)
- (Mary, 2500)
- (Robert, -2500)
- (Mary, 500)
- (Michael, -500)
- (Barbara, 1200)
- (Linda, -1200)
- (Linda, 300)
- (Robert, -300)
- # Reduced by person
- # (Person, Balance)
- (James, 1300) # 1300
- (Mary, 1700) # -1300 + 2500 + 500
- (Robert, -2800) # -2500 + -300
- (Michael, -500) # -500
- (Barbara, 1200) # 1200
- (Linda, 900) # -1200 + 300
- # Mapped to buckets
- # (Bucket, Constant 1)
- (1, 1) # James
- (1, 1) # Mary
- (-3, 1) # Robert
- (-1, 1) # Michael
- (1, 1) # Barbara
- (0, 1) # Linda
- # Reduced by bucket
- # (Bucket, # of People)
- (1, 3) # 3 people in range [1000, 2000)
- (-3, 1) # 1 person in range [-3000, -2000)
- (-1, 1) # 1 person in range [-1000, 0)
- (0, 1) # person in range [0, 1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement