0
我試過itertools,map()但我不知道什麼是錯的。 IHAVE這樣的:在列表中連接列表的列表Python3
[['>Fungi|A0A017STG4.1/69-603 UP-domain-containing protein {ECO:0000313|EMBL:EYE99555.1}', ['-', '-', '-', ... , '-', '-', '-', '-']],['>Fungi|A0A017STG4.1/69-603 UP1-domain-containing protein {ECO:0000313|EMBL:EYE99555.1}', ['-', '-', '-', ... , '-', '-', '-', '-']],['>Fungi|A0A017STG4.1/69-603 UP12-domain-containing protein {ECO:0000313|EMBL:EYE99555.1}', ['-', '-', '-', ... , '-', '-', '-', '-']]]
我想這一點:
[['>Fungi|A0A017STG4.1/69-603 UP-domain-containing protein {ECO:0000313|EMBL:EYE99555.1}','-', '-', '-', ... , '-', '-', '-', '-'],['>Fungi|A0A017STG4.1/69-603 UP1-domain-containing protein {ECO:0000313|EMBL:EYE99555.1}','-', '-', '-', ... , '-', '-', '-', '-'],['>Fungi|A0A017STG4.1/69-603 UP10-domain-containing protein {ECO:0000313|EMBL:EYE99555.1}','-', '-', '-', ... , '-', '-', '-', '-']]
我試圖
for i in x:
map(i,[])
這
import itertools
a = [["a","b"], ["c"]]
print list(itertools.chain.from_iterable(a))
請賜教!
[Flatten(an irregular)list of list]可能的重複](http://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists) –