Reputation: 1
I'm attempting to run a loop faster by using the code to below to create a tuple quickly but can't iterate through the tuple
import pandas as pd
Channel = pd.DataFrame()
for row in Channel.itertuples():
contents = Channel['ID'],Channel['Content']
print(contents)
out: (1,2,3,4,5,'test1','test2','test3','test4','test5')
print(len(contents))
out: 2
I would like to transform this tuple to an tuple of length 5 such as ((1,'test1'),(2,'test2'),(3,'test3'),(4,'test4'),(5,'test5')) without looping through each row in Channel DataFrame.
Upvotes: 0
Views: 113