On Wednesday, August 2, 2017 at 5:25:21 AM UTC+8, Piet van Oostrum wrote:
> Ho Yeung Lee writes:
>
> > which function should be used for this problem?
> >
> I think it is a kind if clustering, or a connectivity problem. There are
> special algorithms for that, not just a simple function. Maybe s
Ho Yeung Lee writes:
> which function should be used for this problem?
>
I think it is a kind if clustering, or a connectivity problem. There are
special algorithms for that, not just a simple function. Maybe scikit-learn has
a suitable algorithm for it.
--
Piet van Oostrum
WWW: http://piet.v
which function should be used for this problem?
On Saturday, July 29, 2017 at 11:02:30 PM UTC+8, Piet van Oostrum wrote:
> Peter Otten <__pete...@web.de> writes:
>
> > Ho Yeung Lee wrote:
> >
> >> from itertools import groupby
> >>
> >> testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
> >> def i
Peter Otten <__pete...@web.de> writes:
> Ho Yeung Lee wrote:
>
>> from itertools import groupby
>>
>> testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
>> def isneighborlocation(lo1, lo2):
>> if abs(lo1[0] - lo2[0]) == 1 or lo1[1] == lo2[1]:
>> return 1
>> elif abs(lo1[1] - lo2[1]
actually i used in this application
if same color is neighbor like connected then group them
i use for segmentation of words in screen capture
https://stackoverflow.com/questions/45294829/how-to-group-by-function-if-any-one-of-the-group-members-has-neighbor-relationsh
i asked here too, but i do
actually i used in this application
if same color is neighbor like connected then group them
i use for segmentation of words in screen capture
https://stackoverflow.com/questions/45294829/how-to-group-by-function-if-any-one-of-the-group-members-has-neighbor-relationsh
i asked here too, but i do
"Ho Yeung Lee" a écrit dans le message de
news:ef0bd11a-bf55-42a2-b016-d93f3b831...@googlegroups.com...
from itertools import groupby
testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
def isneighborlocation(lo1, lo2):
if abs(lo1[0] - lo2[0]) == 1 or lo1[1] == lo2[1]:
return 1
eli
Ho Yeung Lee wrote:
> from itertools import groupby
>
> testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
> def isneighborlocation(lo1, lo2):
> if abs(lo1[0] - lo2[0]) == 1 or lo1[1] == lo2[1]:
> return 1
> elif abs(lo1[1] - lo2[1]) == 1 or lo1[0] == lo2[0]:
> return 1
>
from itertools import groupby
testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
def isneighborlocation(lo1, lo2):
if abs(lo1[0] - lo2[0]) == 1 or lo1[1] == lo2[1]:
return 1
elif abs(lo1[1] - lo2[1]) == 1 or lo1[0] == lo2[0]:
return 1
else:
return 0
groupda = g