from collections import Counter

def filter_non_unique(lst):
  return [item for item, count in Counter(lst).items() if count == 1]
filter_non_unique([
1, 2, 2, 3, 4, 4, 5]) # [1, 3, 5]

 

相关文章:

  • 2022-01-07
  • 2021-09-06
  • 2021-04-20
  • 2021-06-06
  • 2021-12-12
  • 2021-08-08
  • 2021-09-11
猜你喜欢
  • 2022-03-02
  • 2021-09-18
  • 2021-05-13
  • 2022-01-04
相关资源
相似解决方案