Guest User

Untitled

a guest
Jan 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. {'abc':'AGCTAC', 'def': 'AGGTAC', 'ghi':'AGGTAG'}
  2.  
  3. (('A','A','A'),('G','G','G'),('C','G','G'))
  4.  
  5. >>> d = {'abc':'AGCTAC', 'def': 'AGGTAC', 'ghi':'AGGTAG'}
  6. >>> zip(*d.values())
  7. [('A', 'A', 'A'), ('G', 'G', 'G'), ('C', 'G', 'G'), ('T', 'T', 'T'), ('A', 'A', 'A'), ('C', 'G', 'C')]
  8.  
  9. >>> tuple(zip(*d.values()))
  10. (('A', 'A', 'A'), ('G', 'G', 'G'), ('C', 'G', 'G'), ('T', 'T', 'T'), ('A', 'A', 'A'), ('C', 'G', 'C'))
  11.  
  12. >>> from collections import Counter
  13. >>> Counter(zip(*d.values()))
  14. Counter({('A', 'A', 'A'): 2, ('C', 'G', 'G'): 1, ('G', 'G', 'G'): 1, ('T', 'T', 'T'): 1, ('C', 'G', 'C'): 1})
Add Comment
Please, Sign In to add comment