I'm facing a problem since last week with my tsv that I would like to modify and transform into a pandas dataframe.
My file looks like this :
'NC_011745.1_islands.csv': [['PAI 1 EaaA, EibA : 3.1'],
['PAI 2 EaaA : 7.75'],
['PAI 3 Capsule : 4.428571428571429'],
['PAI 4 EaaA : 7.75'],
['PAI 5 ipaH : 7.75'],
['PAI 6 IreA, IrgA homolog adhesin (Iha) : '
'0.96875'],
['PAI 7 IrgA homolog adhesin (Iha), Aerobactin : '
'0.8157894736842105'],
['PAI 8 MsbB2, VirK : 2.8181818181818183'],
['PAI 9 Antigen 43, AIDA-I type : '
'1.3478260869565217']],
'NC_017632_islands.csv': [['PAI 1 Capsule : 15.857142857142858'],
['PAI 2 AAI/SCI-II, direct heme uptake system, '
'Colibactin, Colibactin : 1.819672131147541'],
['PAI 3 F9-like fimbriae, Type 1 fimbriae : '
'3.3636363636363638'],
['PAI 4 Ferrous iron transport : 5.045454545454546'],
['PAI 5 Cah, AIDA-I type, Salmochelin, S fimbriae : '
'2.707317073170732'],
['PAI 6 ECP, Tsh : 13.875'],
['PAI 7 ACE/AEC T6SS : 9.25'],
['PAI 8 Tia/Hek, P fimbriae, F17-like fimbriae, '
'AAI/SCI-II, CNF-1, Alpha-hemolysin, '
'hemagglutinin-like adhesin : 1.088235294117647']],
'NC_017646_islands.csv': [['PAI 1 Allantion utilization : 5.285714285714286'],
['PAI 2 direct heme uptake system : 4.44'],
['PAI 3 ipaH : 27.75'],
['PAI 4 P fimbriae, Aerobactin, Sat, IrgA homolog '
'adhesin (Iha), K1 capsule, K1 capsule, T2SS : '
'1.3058823529411765'],
['PAI 5 P fimbriae, Tia/Hek : 5.842105263157895'],
['PAI 6 VirK, MsbB2 : 10.090909090909092']]}
And I would like to modify and export it as a pandas dataframe like this :
\ EaaA, EibA EaaA Capsule ipaH IreA, IrgA homolog adhesin (Iha) ...
NC_011745.1 3.1 7.75 4.4285.. 7.75 0.96875
NC_017632 NA NA 15.8574 NA NA
The main problem for me is to put it as a dataframe, I tried :
df = pd.DataFrame([dict]).T
df.to_tsv()
but it says that this fucntion is not working with tsv but with csv