{ } Raw JSON

bundles / scipy 1.17.1 / scipy / _lib / _disjoint_set / DisjointSet / subset_size

function

scipy._lib._disjoint_set:DisjointSet.subset_size

source: /scipy/_lib/_disjoint_set.py :220

Signature

def   subset_size ( self x )

Summary

Get the size of the subset containing x.

Extended Summary

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

x : hashable object

Input element.

Returns

result : int

Size of the subset containing x.

Aliases

  • scipy.cluster.hierarchy.DisjointSet.subset_size