Saying we have an association:
asc = <|"A" -> <|"a" -> 1, "b" -> 2, "c" -> 3|>|>;
I want to updated values of "A"
. I have tried doing:
AssociateTo[
asc,
asc["A"][#] -> If[asc["A"][#] === 1, 0 , asc["A"][#]] & /@ {"a", "b", "c"}]
<|"A" -> <|"a" -> 1, "b" -> 2, "c" -> 3|>, 1 -> 0, 2 -> 2, 3 -> 3|>
But this just adds valuesst to the association instead of adding to "A"
How can I update the values in "A"
using AssociateTo
?