I have the following dataframe
bootstrap cluster_main cluster_b distance
1 0 Cluster 0 Cluster 1 0.002016
15 0 Cluster 0 Cluster 3 0.001282
4 0 Cluster 1 Cluster 0 0.000772
10 0 Cluster 2 Cluster 2 0.000990
26 1 Cluster 0 Cluster 2 0.001034
16 1 Cluster 2 Cluster 0 0.000159
31 1 Cluster 3 Cluster 3 0.000889
21 1 Cluster 1 Cluster 1 0.000961
35 2 Cluster 0 Cluster 3 0.099427
36 2 Cluster 1 Cluster 0 0.067036
43 2 Cluster 2 Cluster 3 0.102834
45 2 Cluster 3 Cluster 1 0.069814
I would like to find the bootstrap
s for which there is no one-to-one matching between cluster_main
and cluster_b
.
In the above example, the output should be 2
and 0
, because Cluster 3
in cluster_b
column for bootstrap 2
, is "matched" twice and the same happens for Cluster 0
in the cluster_main
column for bootstrap 0
2
m because in10 0 Cluster 2 Cluster 2 0.000990
? There is matchCluster 2
bootstrap
number, not the cluster number. To put it in other words, for every bootstrap, that there is not a one-to-one match ofcluster_main
tocluster_b
, i would like the bootstrap number. By one to one, I mean a that no Cluster fromcluster_main
is matched twice to a Cluster fromcluster_b
, and vice versacluster_b
are matched withcluster_b
perbootstrap
and it not, get this values? Answer was edited.bootstrap
,cluster_main
ANDcluster_b
should have 4 unique values, otherwise show thebootstrap
number