sorted

python sort list of json by value

python sort list of json by value Question: I have a file consists of JSON, each a line, and want to sort the file by update_time reversed. sample JSON file: { “page”: { “url”: “url1”, “update_time”: “1415387875”}, “other_key”: {} } { “page”: { “url”: “url2”, “update_time”: “1415381963”}, “other_key”: {} } { “page”: { “url”: “url3”, …

Total answers: 4

Is python's sorted() function guaranteed to be stable?

Is python's sorted() function guaranteed to be stable? Question: The documentation doesn’t guarantee that. Is there any other place that it is documented? I’m guessing it might be stable since the sort method on lists is guaranteed to be stable (Notes 9th point: “Starting with Python 2.3, the sort() method is guaranteed to be stable”), …

Total answers: 5