Created
January 5, 2021 07:03
-
-
Save mikesparr/adab7af9af1e5a0047bcb88dd273b8f8 to your computer and use it in GitHub Desktop.
JSON data structure comparison
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// traditional JSON hashmap | |
{ | |
"data": [ | |
{"batch_id": "abc", | |
"records": [ | |
{"subject_id": "111", "features": [1,2,3,4]}, | |
{"subject_id": "222", "features": [1,2,3,4]}, | |
{"subject_id": "333", "features": [1,2,3,4]}, | |
{"subject_id": "444", "features": [1,2,3,4]}, | |
{"subject_id": "555", "features": [1,2,3,4]} | |
] | |
} | |
] | |
} | |
// compare to demo app structure | |
{ | |
"batch_id": "abc", | |
"subjects": ["111","222","333","444","555"], | |
"features: [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment