#NEWLINE# def group_points( self , points ) : #NEWLINE# #INDENT# group_assignment = [ ] #NEWLINE# groups = [ ] #NEWLINE# group_index = 0 #NEWLINE# index = 0 #NEWLINE# for point in points : #NEWLINE# #INDENT# nearest_group_index = self . _determine_nearest_group ( nearest_group_index , groups ) #NEWLINE# if ( nearest_group_index == None ) : #NEWLINE# #INDENT# groups . append ( [ point ] ) #NEWLINE# group_assignment . append ( group_index ) #NEWLINE# group_index += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# group_assignment . append ( nearest_group_index ) #NEWLINE# groups [ nearest_group_index ] . append ( point ) #NEWLINE# #UNINDENT# index += 1 #NEWLINE# #UNINDENT# return np . array ( group_assignment )