【发布时间】:2022-11-22 06:11:48
【问题描述】:
L1 = ['a','b','c','a','b','c']
L2 = ['Cat','Fish','Crow','Dog','Frog','Eagle']
Desired Output 1: D1 = {'a':['Cat','Dog'],
'b':['Fish','Frog'],
'c':['Crow','Eagle']}
Desired Output 2: DF1 = A B C
Cat Fish Crow
Dog Frog Eagle
我只使用从 a 到 c 作为参考,我在 DataFrame 中有 100 多列。
有人可以帮我解决这个问题吗?
【问题讨论】:
标签: python pandas list dictionary zip