meInvent bbird writes:
> ...
> is there any algorithm tutorials or books or external library that
> can have a better result for finding repeated lines as group in grouping
> application
I do not yet understand your problem (and still am not ready to
look at your code).
When I need grouping for
after change to frozenset ,
it seems can classify into 7 repeated group
but, in real data
this consecutive lines can be also a group
but i can not find this,
actually i do not understand how the function works
is there any algorithm tutorials or books or external library that
can have a better
meInvent bbird writes:
... not looking at the details ...
"'str' object has not attribute 'intersection'": apparently,
something is really a string (an 'str') while you expect it to be a set.
"unhashable set": maybe, you try to put a set into another set (or a dict;
or somewhere else where hasha
i do not understand,
how to solve this frozonset ?
Lawrence D’Oliveiro於 2016年10月5日星期三 UTC+8下午2時24分13秒寫道:
> On Wednesday, October 5, 2016 at 2:35:25 PM UTC+13, meInvent bbird wrote:
> > it return unhashable type 'set'
>
> This is what “frozenset” is for--it’s the immutable counterpart of “set”.
def consolidate(sets):
# http://rosettacode.org/wiki/Set_consolidation#Python:_Iterative
setlist = [s for s in sets if s]
for i, s1 in enumerate(setlist):
if s1:
for s2 in setlist[i+1:]:
intersection = s1.intersection(s2)
if intersecti