Nikolay Blokhin Facebook Nikolay Blokhin Instagram Nikolay Blokhin Linkedin Nikolay Blokhin Twitter

Hi, I'm Nikolay Blokhin I build the cool things with Python and Swift

Python: sorting list of dictionaries

It's simple:

my_list = [
    {'name': '004', 'data': '3463'}, 
    {'name': '002', 'data': '76863'}, 
    ...
]
my_list = sorted(my_list, key=lambda k: k['name'])