模拟城市_数据分析(草稿)


rooms={'instrum':{'hamer':{'price':1,'time':1,'compon':['Fe']}},
'materl':{'nail':{'price':1,'time':1...}}
'elem':{'Fe':{},'wood':{},'C':{},'melon':{}}
'food':{'vegatable':}}

df=pd.dataFrame()
for room in rooms:
for tools in room:
time,price,add=[],[],[]
for tool in tools:
time.append(tool['time'])
price.append(tool['price'])
add.append(tool['price']-np.sum([i['price'] for i in tool['compon']]))

df['time']=time
df['price']=price
df['addition'] = add

猜你喜欢

转载自www.cnblogs.com/Yangami/p/10264647.html