How to remove duplicate values from dict?

后端 未结 4 1535
星月不相逢
星月不相逢 2020-12-12 01:52

I\'m trying to remove duplicate values in my dict but its not working:

samples_antibiotics_with_duplicates = {\'S00541-09\': [\'Streptomycin\', \'Sulfamethox         


        
4条回答
  •  无人及你
    2020-12-12 02:32

    If you don't care about retaining original order then set(my_list) will remove all duplicates.

    If you want to retain original order then list(OrderedDict.fromkeys(my_list))

提交回复
热议问题