Incidentally I was playing aroud with this earlier. If you learn Scala, you can do fun stuff like
to get a map of the duplicated indicies to the keys containing them.
E.g. for the above example the
string value of
duplicates is
Map(2 -> Set(dbu_2, iu_2)) (only 1 element, but if there were more duplicates there would be more).
Scala might look a bit cryptic but it's pretty simple once you know that _ is the wildcard, standing for each element of the collection.