Python Forum
Accessing nested keys and values in Dictreader
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessing nested keys and values in Dictreader
#1
Hello,
I'm using Dictreader to store a CSV with column headers in a container. I didn't have any issues bringing the CSV into the
container, but I can't seem to grasp how to access the nested keys and values. From what I can tell, the 1st column is my primary key, but then subsequent column headers are also keys with values. I'm confused on how to retrieve a value from one of the sub-keys. For example, my primary key which I specified as a fieldname is called "Cars". I need to first find "Cars", then a second associated column (also a key)called "Model"...and then the associated value of "Model". Hopefully, that makes sense: Cars > Model > Value of Model.
Reply


Messages In This Thread
Accessing nested keys and values in Dictreader - by cartographer72 - Mar-07-2019, 02:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  create empty sets for keys in a dictionary and add values to the set naughtysensei 1 2,574 Nov-03-2020, 08:32 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020