Created
September 18, 2023 09:29
-
-
Save a-recknagel/3982399c30a306dc771d6b8b43b2698b to your computer and use it in GitHub Desktop.
flat vs nested
This file contains hidden or 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
nested_representation = { | |
5: { | |
"0-100": { | |
12: { | |
"new": 0.123, | |
"old": 0.321, | |
}, | |
24: { | |
"new": 0.1234, | |
"old": 0.4321, | |
} | |
}, | |
"100-200": { | |
12: { | |
"new": 0.0123, | |
"old": 0.3210, | |
}, | |
24: { | |
"new": 0.01234, | |
"old": 0.43210, | |
} | |
}, | |
}, | |
10: { | |
"0-100": { | |
12: { | |
"new": 0.00123, | |
"old": 0.32100, | |
}, | |
24: { | |
"new": 0.001234, | |
"old": 0.432100, | |
} | |
}, | |
"100-200": { | |
12: { | |
"new": 0.000123, | |
"old": 0.321000, | |
}, | |
24: { | |
"new": 0.0001234, | |
"old": 0.4321000, | |
} | |
}, | |
}, | |
} | |
flat_representation = [ | |
5, "0-100", 12, "new", 0.123, | |
5, "0-100", 12, "old", 0.321, | |
5, "0-100", 24, "new", 0.1234, | |
5, "0-100", 24, "old", 0.4321, | |
5, "100-200", 12, "new", 0.0123, | |
5, "100-200", 12, "old", 0.3210, | |
5, "100-200", 24, "new", 0.01234, | |
5, "100-200", 24, "old", 0.43210, | |
10, "0-100", 12, "new", 0.00123, | |
10, "0-100", 12, "old", 0.32100, | |
10, "0-100", 24, "new", 0.001234, | |
10, "0-100", 24, "old", 0.432100, | |
10, "100-200", 12, "new", 0.000123, | |
10, "100-200", 12, "old", 0.321000, | |
10, "100-200", 24, "new", 0.0001234, | |
10, "100-200", 24, "old", 0.4321000, | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment