I'm currently working on a HC single linkage method in Python and when I'm cluster each element I'm storing the current clusters as:
array1=[(0, 1), (3, 5), 2, 4]
elements1=len(array1[0])
array2[((3, 5), 4), (0, 1), 2]
elements2=len(array2[0])
What I want to do is find the number of elements in the zero'th index of each array, for the first elements1 I get the correct answer of 2 but for elements2 I also get 2 but it should be 3, I can see the problem however I can't seem to be able to work around