subset_size — SciPy v1.15.3 Manual (original) (raw)
scipy.cluster.hierarchy.DisjointSet.
DisjointSet.subset_size(x)[source]#
Get the size of the subset containing x.
Note that this method is faster than len(self.subset(x))
because the size is directly read off an internal field, without the need to instantiate the full subset.
Parameters:
xhashable object
Input element.
Returns:
resultint
Size of the subset containing x.