I have the following list of dicts:
defaultdict(<class 'list'>,
{'192.168.20.10/32': [{1: 'aaaaa11111\n'},
{2: 'bbbbb11111\n'},
{2: 'bbbbb11111\n'},
{2: 'bbbbb11111\n'},
{2: 'bbbbb11111\n'}],
'192.168.20.20/32': [{1: 'aaaaa11111\n'},
{2: 'aaaaa11111\n'},
{2: 'bbbbb11111\n'},
{2: 'bbbbb11111\n'},
{2: 'bbbbb11111\n'},
{2: 'bbbbb11111\n'}]})
I would like to iterate over this list object and remove the duplicate list items.
The end result would look something like this:
defaultdict(<class 'list'>,
{'192.168.20.10/32': [{1: 'aaaaa11111\n'},
{2: 'bbbbb11111\n'}],
'192.168.20.20/32': [{1: 'aaaaa11111\n'},
{2: 'bbbbb11111\n'}]})
Please note that I am using defaultdict from collections above:
from collections import defaultdict