Question: So the goal of this code is to print as many permutations as possible from a list of words in a text file. I save all these permutations as a list within a larger list. I am trying to loop through the larger list and print each smaller list as a string.

For example if we have after parsing the input file:
[("hi", "bye", "tree"), ("bye", "hi", "tree")]

I want to print this out as:

hibyetree

byehitree

Answer: 
IIUC, try:

```
df1 = pd.DataFrame({'col1':[*'adrtg']
                   ,'col2':[10,11,12,13,14]
                   ,'data':['DF1']*5})
df2 = pd.DataFrame({'col1':[*'adspq']
                   ,'col2':[10,11,12,13,14]
                   ,'data':['DF2']*5})
df3 = pd.DataFrame({'col1':[*'dcxyz']
                   ,'col2':[10,11,12,13,14]
                   ,'data':['DF3']*5})

pd.concat([df1, df2, df3]).groupby('col1', as_index=False)['col2'].sum()

```

Output:

```
   col1  col2
0     a    20
1     c    11
2     d    32
3     g    14
4     p    13
5     q    14
6     r    12
7     s    12
8     t    13
9     x    12
10    y    13
11    z    14

```
you can use `merge` and actually you will be `cross join`ing the dataframes :

```
import pandas as pd
import random
import string

data = ['DF1', 'DF2', 'DF2']
df = pd.DataFrame([random.choices(string.ascii_lowercase,k=5), [10, 11, 12, 13, 14]], ).T
df.columns = ['col1', 'col2']
da = pd.DataFrame(data, columns=['data'])
res = df.merge(da ,how='cross',)

print(res)

```

output:

```
>>>   
    col1 col2 data
0     j   10  DF1
1     j   10  DF2
2     j   10  DF2
3     d   11  DF1
4     d   11  DF2
5     d   11  DF2
6     k   12  DF1
7     k   12  DF2
8     k   12  DF2
9     e   13  DF1
10    e   13  DF2
11    e   13  DF2
12    n   14  DF1
13    n   14  DF2
14    n   14  DF2

Process finished with exit code 0

```