Guest User

Untitled

a guest
Mar 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. (df.set_index('item')).sub(c.set_index('item').reindex(df.item).value,axis=0).gt(0).groupby(level=0).sum()
  2. Out[646]:
  3. A B C
  4. item
  5. a 1.0 1.0 0.0
  6. b 0.0 2.0 1.0
  7. c 1.0 1.0 1.0
  8. d 2.0 0.0 0.0
Add Comment
Please, Sign In to add comment