[英]I want to create a nested dictionary from a csv file with headers as keys
[英]How to represent nested values in a csv file? I want to seamlessly load the file into a (nested) python dictionary
我的第一个想法是通过引用将 csv 文件链接在一起。 这将使每个单元格的信息保持简单。 如果链变长并且找到要编辑的正确 csv 文件变得过于复杂,则可能会出现潜在问题。
demographics:
description: This is a description of demographics
type: string
value:
ethnicity:
-a
-b
-c
node: node801832
somerandom:
random1: 201901
random2: lkk133
A column in popdemographics.csv
demographics
description.csv
node.csv
somerandom.csv
The csv file referenced by description.csv
description
This is a description of demographics
type.csv
这在 csv 中是不可能的。 如果您希望“非技术人员”的可读性,您可以考虑使用 YAML
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.