Reputation: 2685
I am trying to find some answer, but all I found is not regarding my problem. Can someone please tell me how I can append row into other row at the same time adding some extra column?
So far I have something like this:
for row in reader_action[0]:
action_res.append([row[0:2],0,row[2:]])
and the output is:
[['1', '2'], 0, ['3', '4', '5']]
but what I am looking for is:
['1', '2', 0, '3', '4', '5']
Upvotes: 0
Views: 53
Reputation: 2242
From your description, I think you want:
for row in reader_action[0]:
action_res.append([row[0:2] + [0] + row[2:]])
Upvotes: 2