Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. sample = D1.merge(D2,left_on=[ 'A' or'B' or'C'or 'D' or E],
  2. right_on=['A'], how='left')
  3.  
  4. sample = pd.concat([D1.merge(D2,left_on='A', right_on= 'A', how='left'),
  5. D1.merge(D2,left_on='B', right_on='A', how='left'), D1.merge(D2,
  6. left_on='C',right_on='A', how='left'),D1.merge(D2,left_on='D',
  7. right_on='A', how='left'),D1.merge(D2,left_on='E', right_on='A',
  8. how='left')])
  9.  
  10. dupes = (sample['A'] == sample['B']) == (sample['C'] == sample['D']) ==
  11. sample['E']
  12. sample=sample.loc[~dupes]
  13.  
  14.  
  15.  
  16. ValueError: The truth value of a Series is ambiguous. Use a.empty,
  17. a.bool(), a.item(), a.any() or a.all().
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement