Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FreqItemset(items=[u'bbb_1', u'ccc_1', u'ccc_2', u'aaa_1', u'ccc_3'], freq=379)
- FreqItemset(items=[u'aaa_1_1', u'ccc_1', u'ccc_2', u'ccc_3'], freq=375)
- ...
- filtered_result = model.freqItemsets()
- .filter(lambda x: x.items[0].startswith('aaa_')).collect()
- filtered_result = model.freqItemsets()
- .filter(lambda x: x.items[0].startswith('aaa_'))
- .filter(lambda x: x.items[1].startswith('aaa_'))
- .filter(lambda x: x.items[2].startswith('aaa_'))
- ...
- .collect()
- list_1 = [u'bbb_1', u'ccc_1', u'ccc_2', u'aaa_1', u'ccc_3']
- list_2 = [u'aaa_1_1', u'ccc_1', u'ccc_2', u'ccc_3']
- results_1 = [s for s in list_1 if s.startswith('aaa')]
- results_2 = [s for s in list_2 if s.startswith('aaa')]
- print(results_1)
- print(results_2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement