I have a dictionary:
d = {\'Trump\': [\'MAGA\', \'FollowTheMoney\'],
\'Clinton\': [\'dems\', \'Clinton\'],
\'Stein\': [\'FollowTheMoney\', \'Atlant
You can use Counter to tally how many times each value appears in d.
d = {'Trump': ['MAGA', 'FollowTheMoney'],
'Clinton': ['dems', 'Clinton'],
'Stein': ['FollowTheMoney', 'Atlanta']}
from collections import Counter
c = Counter(x for xs in d.values() for x in xs)
In this example, the value of c is
Counter({'Atlanta': 1,
'Clinton': 1,
'FollowTheMoney': 2,
'MAGA': 1,
'dems': 1})
Then choose values for which the count is exactly 1.
update_d = {k: [v for v in vs if c[v] == 1] for k, vs in d.items()}