0

I have the following data:

l = [
      {'FutureReleaseStartDate': u'2016-10-04', 'Code': u'SDRENT'},
      {'FutureReleaseStartDate': u'2016-10-05', 'Code': u'SDRENT'},
      {'FutureReleaseStartDate': u'2016-10-05', 'Code': u'HDRENT'},
      {'FutureReleaseStartDate': u'2016-10-05', 'Code': u'HDRENT'}
]

Doing a unique set of the above would get me:

l = [
      {'FutureReleaseStartDate': u'2016-10-04', 'Code': u'SDRENT'},
      {'FutureReleaseStartDate': u'2016-10-05', 'Code': u'SDRENT'},
      {'FutureReleaseStartDate': u'2016-10-05', 'Code': u'HDRENT'}
]

How would I do the above? Note that I am not looking to get unique objects based on a key, such as Python - List of unique dictionaries, but on the entire object in the array.

Community
  • 1
  • 1
David542
  • 104,438
  • 178
  • 489
  • 842

0 Answers0