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) –