I have a list of dictionaries where one of the key values is NOT unique:
arr = [{'host': '144.217.103.15', 'port': 3000},
{'host': '158.69.115.201', 'port': 8080},
{'host': '144.217.103.15', 'port': 1020},]
I want to make the given array unique in regards to the 'host' key so that the final output would be:
result = [{'host': '158.69.115.201', 'port': 8080},
{'host': '144.217.103.15', 'port': 1020},]
or it could be:
result = [{'host': '144.217.103.15', 'port': 3000},
{'host': '158.69.115.201', 'port': 8080},]
What is the Pythonic way of doing so?