JSON often returns sort of 'nested' associations like so:
assoc = <|"key1" -> <|"a" -> 1, "b" -> 2|>,
"key2" -> <|"a" -> 3, "b" -> 4|>|>
It is often needed to apply f
as follows.
assoc = <|"key1" -> <|"a" -> f[1], "b" -> 2|>,
"key2" -> <|"a" -> f[3], "b" -> 4|>|>
I see some traditional ways, i.e. MapAt
, but I'm searching more specific way for the task, like KeyValueMap
or something similar. Which one would you recommend?
(Parsing APIs results is a good example of usecase.)