order_nested_partition_labels

order_nested_partition_labels#

graph_tool.inference.order_nested_partition_labels(x)[source]#

Returns a copy of nested partition x, with the group labels ordered decreasingly according to group size at each level.

Parameters:
xiterable of iterables of int values or iterable of PropertyMap

Partition.

Returns:
ylist of numpy.ndarray or list of PropertyMap

Nested partition with ordered labels.

Examples

>>> x = [[0, 2, 2, 1, 1, 1, 2, 2, 2], [1, 1, 0], [1, 1]]
>>> gt.order_nested_partition_labels(x)
[array([2, 0, 0, 1, 1, 1, 0, 0, 0], dtype=int32), array([1, 0, 0], dtype=int32), array([0, 0], dtype=int32)]