I'm trying to intersect frozensets in Python, but not getting the desired result. My intersection array, LCC, has 100s of strings.
LCC = ['A','E...']
fs1 = frozenset('A')
fs2 = frozenset('E830')
fs1.intersection(LCC)
fs2.intersection(LCC)
The results are:
frozenset({'A'})
frozenset()
I would expect the second function to yield frozenset({'E830'})
Does anyone known how to get this to work with wildcards? Or is it impossible since the string being passed in to LCC is interpreting the wildcards literally?
I assume your '...' is a wildcard pattern meaning any characters of length three.(Regular expression syntax)
You can use regular expressions like this.
This will output the following.