Search Results

Search found 1 results on 1 pages for 'user2924306'.

Page 1/1 | 1 

  • Remove duplicates from a list of nested dictionaries

    - by user2924306
    I'm writing my first python program to manage users in Atlassian On Demand using their RESTful API. I call the users/search?username= API to retrieve lists of users, which returns JSON. The results is a list of complex dictionary types that look something like this: [ { "self": "", "name": "fred", "avatarUrls": { "24x24": "", "16x16": "", "32x32": "", "48x48": "" }, "displayName": "Fred F. User", "active": false }, { "self": "", "name": "andrew", "avatarUrls": { "24x24": "", "16x16": "", "32x32": "", "48x48": "" }, "displayName": "Andrew Anderson", "active": false } ] I'm calling this multiple times and thus getting duplicate people in my results. I have been searching and reading but cannot figure out how to deduplicate this list. I figured out how to sort this list using a lambda function. I realize I could sort the list, then iterate and delete duplicates. I'm thinking there must be a more elegant solution. Thank you!

    Read the article