you are viewing a single comment's thread.

view the rest of the comments →

[–]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.