maintaining order in json (python flask) -


i made sorted dictionary pass through json javascript, however, seems whenever throw json.dumps() changes order alphabetical keys. critical keep in order or else not work. there way achieve this?

objects in json unordered collection of key:value pairs (same dictionaries in python), should use different data structure if order relevant.

a structure (in json) work:

{ "columns" : [ "id", "name", "age"],   "rows" : [[ "john", "john doe", 42],             [ "jane", "jane miller", 28]     ] } 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -