Python Forum
compacting a mutable sequence
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
compacting a mutable sequence
#1
i am looking for some already existing implementation of this logic i am ready to implement for myself, if necessary. i want to "compact" a mutable sequence by removing duplicates, keeping the order of both the unique items and each first item of duplicates. converting to a set loses the original order, so it is not an option to convert to a set and convert back, but maybe a set can be used to help detect duplicates in an implementation. anyone know of an existing implementation?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
compacting a mutable sequence - by Skaperen - Jan-22-2018, 03:44 AM
RE: compacting a mutable sequence - by Larz60+ - Jan-22-2018, 04:19 AM
RE: compacting a mutable sequence - by Skaperen - Jan-22-2018, 06:17 AM
RE: compacting a mutable sequence - by Gribouillis - Jan-22-2018, 06:29 AM
RE: compacting a mutable sequence - by Skaperen - Jan-22-2018, 06:46 AM
RE: compacting a mutable sequence - by Gribouillis - Jan-22-2018, 06:54 AM
RE: compacting a mutable sequence - by Skaperen - Jan-23-2018, 03:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  using mutable in function defintion as optional paramter akbarza 8 674 Apr-27-2024, 09:59 PM
Last Post: snippsat
  mutable argument in function definition akbarza 1 565 Dec-15-2023, 02:00 PM
Last Post: deanhystad
  mutable values to string items? fozz 15 3,159 Aug-30-2022, 07:20 PM
Last Post: deanhystad
  "'DataFrame' objects are mutable, thus they cannot be hashed" Mark17 1 6,986 Dec-25-2020, 02:31 AM
Last Post: tinh
  Mutable Strings millpond 3 2,713 Aug-24-2020, 08:42 AM
Last Post: millpond
  What is the meaning of mutable data type? qliu 3 3,077 Apr-17-2020, 07:20 PM
Last Post: deanhystad
  copying parts of mutable sequences Skaperen 1 2,307 Dec-02-2019, 10:34 AM
Last Post: Gribouillis
  A mutable string?? silentknight85 5 4,820 May-31-2019, 10:11 AM
Last Post: silentknight85
  compacting multiple ranges Skaperen 2 3,167 Oct-11-2017, 08:33 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020