shuffle_partition_labels#
- graph_tool.inference.shuffle_partition_labels(x)[source]#
Returns a copy of partition
x
, with the group labels randomly shuffled.- Parameters:
- xiterable of
int
values orPropertyMap
Partition.
- xiterable of
- Returns:
- y
numpy.ndarray
orPropertyMap
Partition with shuffled labels.
- y
Examples
>>> x = [0, 0, 0, 1, 1, 1, 2, 2, 2] >>> gt.shuffle_partition_labels(x) array([0, 0, 0, 2, 2, 2, 1, 1, 1], dtype=int32)