I assume the output zipis a tuple, so you can try the following:
temp = zip(*df['input'].apply(lambda x : do_something(x, number_of_columns_to_be_added)))
for i, value in enumerate(temp, 1):
key = 'n'+str(i)
df[key] = value
tempwill hold all entries and then you are iterateover tempto assign values to your dict using your specific keys. Hope this matches your original idea.
source
share