我有一个这样的清单
[['N_ALA_A0001', [9.25, 24.41, 64.13]]]
[['O_ALA_A0001', [9.05, 21.51, 64.38]]]
[['N_ALA_A0001', [9.25, 24.41, 64.13]]]
[['N_TYR_A0002', [7.84, 21.93, 66.24]]]
[['N_ALA_A0001', [9.25, 24.41, 64.13]]]
[['O_TYR_A0002', [5.48, 20.92, 65.6]]]
[['N_ALA_A0001', [9.25, 24.41, 64.13]]]
[['N_VAL_A0003', [6.19, 18.75, 65.89]]]
[['N_ALA_A0001', [9.25, 24.41, 64.13]]]
我想删除冗余列表并打印 uniq 行
[['N_ALA_A0001', [9.25, 24.41, 64.13]]]
[['O_ALA_A0001', [9.05, 21.51, 64.38]]]
[['N_TYR_A0002', [7.84, 21.93, 66.24]]]
[['O_TYR_A0002', [5.48, 20.92, 65.6]]]
[['N_VAL_A0003', [6.19, 18.75, 65.89]]]
我试过, strip
, set
,uniq
但这不起作用;它给出了错误:
AttributeError:“list”对象没有属性“readline”
print set(uniqlist)
类型错误:不可散列类型:“列表”
任何帮助,将不胜感激。