Python Forum
Changing elements of a list to match another list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing elements of a list to match another list
#3
My understanding was he wanted the first value in the sublist to be the lowest value in reference_list that is greater than or equal to the original value. So his while condition should be while i[0] not in reference_list:.

But I agree the problem is not clearly defined.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Changing elements of a list to match another list - by ichabod801 - Jul-11-2019, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  unable to remove all elements from list based on a condition sg_python 3 460 Jan-27-2024, 04:03 PM
Last Post: deanhystad
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 495 Oct-17-2023, 09:46 AM
Last Post: tomciodev
  No matter what I do I get back "List indices must be integers or slices, not list" Radical 4 1,186 Sep-24-2023, 05:03 AM
Last Post: deanhystad
  Delete strings from a list to create a new only number list Dvdscot 8 1,556 May-01-2023, 09:06 PM
Last Post: deanhystad
  List all possibilities of a nested-list by flattened lists sparkt 1 929 Feb-23-2023, 02:21 PM
Last Post: sparkt
  Checking if a string contains all or any elements of a list k1llcod3 1 1,117 Jan-29-2023, 04:34 AM
Last Post: deanhystad
  Сheck if an element from a list is in another list that contains a namedtuple elnk 8 1,859 Oct-26-2022, 04:03 PM
Last Post: deanhystad
  How to change the datatype of list elements? mHosseinDS86 9 2,011 Aug-24-2022, 05:26 PM
Last Post: deanhystad
Question Keyword to build list from list of objects? pfdjhfuys 3 1,579 Aug-06-2022, 11:39 PM
Last Post: Pedroski55
  ValueError: Length mismatch: Expected axis has 8 elements, new values have 1 elements ilknurg 1 5,170 May-17-2022, 11:38 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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