Python Forum
Copying the order of another list with identical values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copying the order of another list with identical values
#1
I have a list containing a lot of serial numbers. Here are some of them:

hub_sn = [10001, 10002, 10003, 10004, 10005]

These serial numbers came from a monitoring database where the serial numbers would be shown as Online or Offline.
The first list is static, type-written manually. Now, from the monitoring database, I took those serial number and checked if they are online or offline.
I came up with a new list.

hub_sn_avail = [(10003, 'Online'), (10004, 'Offline'), (10002, 'Online'), (10001, 'Offline'), (10005, 'Online')]

How would I follow the order of the static list?
Reply


Messages In This Thread
Copying the order of another list with identical values - by gohanhango - Nov-29-2023, 01:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  remove duplicates from dicts with list values wardancer84 27 842 May-27-2024, 04:54 PM
Last Post: wardancer84
  Search Excel File with a list of values huzzug 4 1,369 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Copy List Not Copying BAbdulBaki 3 706 Aug-19-2023, 02:03 AM
Last Post: perfringo
  Comparing List values to get indexes Edward_ 7 1,334 Jun-09-2023, 04:57 PM
Last Post: deanhystad
  Why do I have to repeat items in list slices in order to make this work? Pythonica 7 1,471 May-22-2023, 10:39 PM
Last Post: ICanIBB
  Adding values with reduce() function from the list of tuples kinimod 10 2,876 Jan-24-2023, 08:22 AM
Last Post: perfringo
  user input values into list of lists tauros73 3 1,167 Dec-29-2022, 05:54 PM
Last Post: deanhystad
  AttributeError: 'list' object has no attribute 'values' ilknurg 4 15,317 Jan-19-2022, 08:33 AM
Last Post: menator01
  Need to parse a list of boolean columns inside a list and return true values Python84 4 2,221 Jan-09-2022, 02:39 AM
Last Post: Python84
  List of dataframe values beginning with x,y or z glidecode 3 2,005 Nov-08-2021, 10:16 PM
Last Post: glidecode

Forum Jump:

User Panel Messages

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