[英]Compare Two different size list of lists and create a new list
我有以下兩個列表列表:
A=[['NUCPANT 500.00', 'MID500 500.00', '1 '], ['MID230 230.00', 'DOWNTN 230.00', '2 ']]
B=[['NUCPANT 500.00', 151], ['MID230 230.00', 153], ['DOWNTN 230.00', 154], ['MID500 500.00', 152]]
必填 output:
C = [[151, 152, '1'],[153, 154, '2']]
我在 output 中想要的是:
提前致謝
我做了以下得到我想要的
sdxBrnInfo = []
for x in sdxReader:
for y in busNamebusNumber:
if (x[0] == y[0]):
for z in busNamebusNumber:
if (x[1] ==z[0]):
sdxBrnInfo.append([y[1], z[1], x[2]])
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.