Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. FreqItemset(items=[u'bbb_1', u'ccc_1', u'ccc_2', u'aaa_1', u'ccc_3'], freq=379)
  2. FreqItemset(items=[u'aaa_1_1', u'ccc_1', u'ccc_2', u'ccc_3'], freq=375)
  3. ...
  4.  
  5. filtered_result = model.freqItemsets()
  6. .filter(lambda x: x.items[0].startswith('aaa_')).collect()
  7.  
  8. filtered_result = model.freqItemsets()
  9. .filter(lambda x: x.items[0].startswith('aaa_'))
  10. .filter(lambda x: x.items[1].startswith('aaa_'))
  11. .filter(lambda x: x.items[2].startswith('aaa_'))
  12. ...
  13. .collect()
  14.  
  15. list_1 = [u'bbb_1', u'ccc_1', u'ccc_2', u'aaa_1', u'ccc_3']
  16. list_2 = [u'aaa_1_1', u'ccc_1', u'ccc_2', u'ccc_3']
  17.  
  18. results_1 = [s for s in list_1 if s.startswith('aaa')]
  19. results_2 = [s for s in list_2 if s.startswith('aaa')]
  20.  
  21. print(results_1)
  22. print(results_2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement