0

From it now I have a structure that looks like a list of lists (actually I don't know what that is), it contains multiple lists, each list has 2 rows and 6 columns:

[    class      c1       c2        c3         c4                     filename
0      0      0.731592  0.61525  0.43918       0.215335  10_Gibson-Price%20and%20Goodwin.pdf-5.txt
1      2      0.650248  0.81175  0.292786      0.112109  10_Gibson-Price%20and%20Goodwin.pdf-5.txt

[2 rows x 6 columns],   
           class        c1      c2         c3       c4                 filename                     
0            2       0.274740  0.5705   0.30198   0.094384       10_Gibson-Price%20and%20Goodwin.pdf-6.txt
1            0       0.306032  0.31125  0.486563  0.235986       10_Gibson-Price%20and%20Goodwin.pdf-6.txt
[2 rows x 6 columns], 
...
...
[2 rows x 6 columns], ]

So I want convert this big list to a pandas dataframe which looks like below:

file_name   class   c1        c2        c3           c4       file_name
2a.txt        0   0.712518  0.61525  0.43918       0.2065      2a.txt
2a.txt        1  0.635078   0.81175  0.29278       0.0925      2a.txt
2b.txt        2  0.551273   0.5705   0.30198       0.0922      2b.txt
2b.txt        0  0.550212   0.31125  0.486563      0.2455      2b.txt

Thanks, I'm waiting for someone can help me with this.

Simon
  • 3
  • 3
  • This rather looks like a list of DataFrames, you can "*just*" `concat` them (you might need to add names). – mozway Sep 20 '22 at 08:39

0 Answers0