==== Sort an Array by a key value ==== \\ In case you want an array [] ordered by a numeric value in items wanted by key: # numeric ascending order data = sorted(data, key=lambda x: x['yourkey']) # numeric descending order data = sorted(data, reverse=True, key=lambda x: x['yourkey'])