I need to create a pandas dataframe using information from two different sources. For example,
for row in df.itertuples():
c1, c2, c3 = row.c1, row.c2, row.c3
returnedDict = function(row.c1, row.c2, row.c3)
The first 3 columns in the dataframe I want should contain c1, c2, c3, and the rest of the columns come from the key of the returnedDict. The number of keys in the returnedDict is 100. How can I initialize such Dataframe and append the row in the dataframe at each for loop?
Expected output
col1 col2 col3 key1 ... key100
--------------------------------------------------------------
c1 c2 c3 returnedDict[key1] returnedDict[key100]