This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / _lib / _disjoint_set / DisjointSet / subset_size

function

scipy._lib._disjoint_set:DisjointSet.subset_size

source: build-install/usr/lib/python3.14/site-packages/scipy/_lib/_disjoint_set.py:232

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