Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import product
- d = {'ballot1': ['a','b','a','a','b','a','a','b'],
- 'ballot1_x':['c','c','d','d','a','a','a','a']}
- df1=pd.DataFrame(d)
- for i in product(set(df1['ballot1']), set(df1['ballot1_x'])):
- print(str(i[0])+str(i[1]))
- a b
- c 1 1
- d 2 0
- a 2 2
Add Comment
Please, Sign In to add comment