python list去重,保持顺序
python list去重,保持顺序list_name=datafm['线别'] name=[]##生成list for i in range(len(list_name)): if not str(list_name[i])=='nan': name.append(list_name[i][0:-2]) name_only = list(set(name))###去重 name_only.sort(key = name.index)