I have a list of data called ID
, and another list called Dates
. They are paired data, and the lists are of equal lengths, approximately 800,000 items long each. I want to pair each item from each list, put them into a tuple, and append these tuples into another list. I.e.:
ID = [1,2,3,4,...]
Dates = [2012-04-05, 2012-04-07, 2012-04-08, 2012-04-09,...]
ID_Datetime = [(1,2012-04-05), (2,2012-04-07), (3,2012-04-08), (4,2012-04-09)...]
Here's my try. It seems like it works, but when I tried to use it on the actual lists, my computer crashed because it couldn't handle the data.
def list_combine():
for i in ID:
for j in Dates:
ID_Datetime.append((i, j))
Any tips on a faster way to do this?