Skip to content

gghh/intersections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

intersections

Computes intersection explosions.

How to use it

import intersections

sets = {'a': set(['apple', 'banana']),
        'b': set(['orange', 'apple', 'watermelon']),
        'c': set(['peach', 'plum', 'pear', 'apple', 'orange'])}
allInters = intersections.intersLookup(sets)
print intersections.explode(sets.keys(), allInters)

gives

{frozenset(['a', 'c', 'b']): 1,
 frozenset(['a', 'b']): 0,
 frozenset(['a', 'c']): 0,
 frozenset(['c', 'b']): 1,
 frozenset(['a']): 1,
 frozenset(['b']): 1,
 frozenset(['c']): 3}

See http://gghh.name/dibtp/?p=565 for more details.

About

Computes intersection explosions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages