【发布时间】:2018-11-18 12:39:42
【问题描述】:
我在 Python 的列表中嵌入了一个字典。我想只提取字典,然后将其导出到 csv 文件,每列代表一个唯一的字典键(即日期)。例如,这是我拥有的嵌入式字典的(小 sn-p):
[[{'Date': '2018-069', 'Title': 'The Effect of Common Ownership on Profits : Evidence From the U.S. Banking Industry', 'Author': 'Jacob P. Gramlich & Serafin J. Grundl'}, {'Date': '2018-068', 'Title': 'The Long and Short of It : Do Public and Private Firms Invest Differently?', 'Author': 'Naomi E. Feldman & Laura Kawano & Elena Patel & Nirupama Rao & Michael Stevens & Jesse Edgerton'}]]
对此的任何帮助将不胜感激!
【问题讨论】:
-
l[0][0]?然后将其转换为 csv
标签: python dictionary