其实我有这种类型的字典
d={'a':{'s':'100100.sss','s1':'100200.ss2','s2':'100200.333'},
'b':{'t':'100100.yyy','u':'100100.rrr','i':'1001500ttt'},'c':{'f':'g','y':'o'}}
从这里我正在创建这种类型的字典
temp={'a':['100100','100200','100200'],'b':['100100',100100'],'c'=[]}
为此,我正在使用这样的代码
temp={}
for k,v in d.items():
temp[k]=[]
for key,val in v.items():
templist=val.split(".")
if templist[0].isdigit():
if templist[0] not in a.values():
temp[k].append(templist[0])
else:
continue
其实我想要这种类型的字典
temp={'a':['100100','100200'],'b':['100100'],'c'=[]}