【发布时间】:2020-07-20 20:04:29
【问题描述】:
如果 sheet1 的值与 sheet2 匹配,我正在尝试从 sheet2 获取数据。
例如:
工作表1:
name school
Rahul DPS
Seema KV
表2:
school_name profile color subject
DPS 1 orange,blue math
DPS 2 red,purple english
KV 1 yellow science
如果在 sheet1 school 中与 sheet2 school_name 匹配,则取其所有数据,即。个人资料、颜色、主题。
例如。 sheet1 DPS 与 sheet2 DPS 匹配比输出如下:
name= Rahul
school:{DPS:[{'profile':1,'color':orange,blue,'subject':math},{'profile':2,'color':red,purple,'subject':english}]}
【问题讨论】:
标签: python-3.x excel pandas list dictionary