- taskpeos=[' sngao ', 'yueli]
- clas=[' irrelevant ', 'single', 'vehicle scheduling and site maintenance,' one car interaction ', 'ODD related technologies',' vehicle remote control]
- res_list=[[' irrelevant ', '1', '3'], [' vehicle scheduling and site maintenance ', '4', '3'], [' one car interaction ', '5', '2'], [' send single ', '1', '1'], [' vehicle remote control ', '0', '1']]
Output:
- [{' type ':' not 'and' sngao ':' 1 ', 'yueli', '3'}, {' type ':' vehicle scheduling and site maintenance ', 'sngao', '4', 'yueli', '3'}, {' type ':' one car interaction ', 'sngao', '5', 'yueli', '2'}, {' type ':' ODD related technologies', 'sngao' : '0', 'yueli' : '0'}, {' type ':' single ', 'sngao' : '1', 'yueli' : '1'}, {' type ':' vehicle remote control ', 'sngao' : '0', 'yueli' : '1'}]
CodePudding user response:
Taskpeos=[' sngao ', 'yueli]
Clas=[' irrelevant ', 'single', 'vehicle scheduling and site maintenance,' one car interaction ', 'ODD related technologies',' vehicle remote control]
Res_list=[[' irrelevant ', '1', '3'], [' vehicle scheduling and site maintenance ', '4', '3'], [' one car interaction ', '5', '2'], [' send single ', '1', '1'], [' vehicle remote control ', '0', '1']]
"'
[{' type ':' not 'and' sngao ':' 1 ', 'yueli', '3'}, {' type ':' vehicle scheduling and site maintenance ', 'sngao', '4', 'yueli', '3'},
{' type ':' one car interaction 'and' sngao ', '5', 'yueli', '2'}, {' type ':' ODD related technologies', 'sngao' : '0', 'yueli' : '0'},
{' type ':' single ', 'sngao' : '1', 'yueli' : '1'}, {' type ':' vehicle remote control ', 'sngao' : '0', 'yueli' : '1'}]
"'
Res=[]
For the item in res_list:
One_res={}
One_res [' type ']=item [0]
One_res [taskpeos [0]]=item [1]
One_res [taskpeos [1]]=item [2]
Res. Append (one_res)
Print (res)
CodePudding user response:
taskpeos=[' sngao ', 'yueli]
Clas=[' irrelevant ', 'single', 'vehicle scheduling and site maintenance,' one car interaction ', 'ODD related technologies',' vehicle remote control]
Res_list=[[' irrelevant ', '1', '3'],
[' vehicle scheduling and site maintenance ', '4', '3'],
Car interaction [' people ', '5', '2'),
[' single ', '1', '1'],
[' vehicle remote control ', '0', '1']
]
X=[[k, '0', '0'] in the set for k (clas) - set (I for I, _, _ in res_list)]
Res_list. The extend (x)
Taskpeos=[' type '] + taskpeos
Res=[dict (zip (taskpeos, I)) for I res_list] in
Print (res)
CodePudding user response: