在Python 3,我有一個元組和以下轉換列表namedtuple
Row = namedtuple('Row', ['first', 'second', 'third'])
A = ['1', '2', '3']
如何插入這個數組到一個名爲元組數組A
?請注意,在我的情況,我不能直接這樣做:
newRow = Row('1', '2', '3')
我曾嘗試不同的方法
1. newRow = Row(Row(x) for x in A)
2. newRow = Row() + data # don't know if it is correct