pandas - 迭代添加新字符串作为列表中的元素

时间:

我猜它应该是:


shortenedSeq_list =[] 


counter=0


stringstring=[]


for rows in df.itertuples():


 strSeq2 = [rows.sequence]


 strremove2 = [rows.shortened_mobidb_consensus]


 for item in strremove2:


 res = ast.literal_eval(item)


 for item in res:


 stringstring.append(strSeq2[item[0]-1:item[1]])



stringstring



...