I I have an array of json objects like this
[{"id":21,"username":"prerrit.kumar","email":"[email protected]","name":"Prerrit Kumar","bio":null,"skype":"","linkedin":"","twitter":"","theme_id":1,"color_scheme_id":1,"state":"active","created_at":"2013-09-26T11:40:02Z","extern_uid":null,"provider":null},{"id":22,"username":"aashish.arora","email":"[email protected]","name":"Aashish Arora","bio":null,"skype":"","linkedin":"","twitter":"","theme_id":1,"color_scheme_id":1,"state":"active","created_at":"2013-09-26T11:40:54Z","extern_uid":null,"provider":null}]
I would like to find a json object by the username and then find its id, I am new to python, I know the json.loads and have been able to get individual rows, but i think its not good from perf point of view to iterate one by one.
O(n)
unless you're willing to sort by username first. – xbonez Nov 1 at 8:39