我有兩個列表:合併兩個多維列出一個列表中在Python
a_list =
[['2017-06-03 23:01:49', 0], ['2017-06-03 23:02:49', 712.32], ['2017-06-03 23:03:49', 501.21].......]
b_list =
[['2017-06-03 23:01:49', 100.01], ['2017-06-03 23:02:49', 50.01], ['2017-06-03 23:03:49', 521.79].......]
我需要合併a_list
與b_list
所以它變成了:
combined_list =
[['2017-06-03 23:01:49', 0, 100,01], ['2017-06-03 23:02:49', 712.32, 50.01], ['2017-06-03 23:03:49', 501.21, 521.79].......]
我將如何實現這一目標?
爲了獲得慾望輸出,你可以做'[key] + value',這也允許把它放在列表理解中 – Copperfield