Assume I have
ass = <|"A" -> 1, "B" -> <|"B1" -> 2, "B2" -> 3|>|>
I can flatten it to
<|"A" -> 1, {"B", "B1"} -> 2, {"B", "B2"} -> 3|>
via the hints in
How to "flatten" a nested Association?
However, how can I 'unflatten' it, i.e. do the reverse operation?
The associations can be arbitrarily long, could be nested also deeper than here, and contain also Lists or other data types as values. Further the same sub-keys might occur in different parts, for example a key "B2" could be present also in an association "C"-> . In other words, the structure should be as given by the Keys in the flattened version.
Thanks for any help!