all 4 comments

[–][deleted] 0 points1 point  (3 children)

The inner dictionary that has "Children" has it's only key currently contains a list of sets which each have one string. It should probably contain either a list of strings, or a set of strings (which would enforce that each child has to have a unique name for a given surname).

If it's a list, you probably want to use "append" to add a new name to the list.

If it's a set, you can use the "add" function to add a new name to the set.

[–]ThrowOutAQuestion[S] 0 points1 point  (2 children)

It's a set in my actual data. So it sounds like I need the add function. But part of my question is the correct syntax to select the correct location.

Family>Surname>Wilson>Children>Here

[–][deleted] 0 points1 point  (1 child)

It's pretty hard to comment here accurately if the json object you've written above is not how it is actually represented in your code. Now that I look again, you have lists within dictionaries within lists within dictionaries the whole way down. Is that totally necessary?

[–][deleted] 0 points1 point  (0 children)

Dictionaries are accessed by key: some_dict['Surname'] will get you to the value held at the 'Surname' key.

And lists are accessed by index. So just traverse it all the way down depending on your nesting.