Python Forum
Looking for data/info on a perticular data-proccesing problem.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking for data/info on a perticular data-proccesing problem.
#2
This is one way to get these results:

  1. convert the lists to sets,
  2. take the union of all three sets
  3. convert union to set
  4. then convert that set to a list
  5. sort the list

Example:
taba = ['aligators','bats','eagles']
tabb = ['bats','cats','eagles']
tabc = ['cats','dogs','eagles']

tlist = list(set(set(taba).union((set(tabb).union(set(tabc))))))
tlist.sort()
print(f"tlist: {tlist}")
Output:
tlist: ['aligators', 'bats', 'cats', 'dogs', 'eagles']
Reply


Messages In This Thread
RE: Looking for data/info on a perticular data-proccesing problem. - by Larz60+ - Apr-28-2021, 01:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with to check an Input list data with a data read from an external source sacharyya 3 663 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  Take data from web page problem codeweak 5 1,092 Nov-01-2023, 12:29 AM
Last Post: codeweak
  Input network device connection info from data file edroche3rd 6 1,306 Oct-12-2023, 02:18 AM
Last Post: edroche3rd
  What is all the info in the info window in Idle? Pedroski55 3 849 Jul-08-2023, 11:26 AM
Last Post: DeaD_EyE
  Matplot / numpy noisy data problem the57chambers 1 792 Feb-09-2023, 03:27 AM
Last Post: deanhystad
  Write sql data or CSV Data into parquet file mg24 2 2,657 Sep-26-2022, 08:21 AM
Last Post: ibreeden
  Load multiple Jason data in one Data Frame vijays3 6 1,786 Aug-12-2022, 05:17 PM
Last Post: vijays3
  Django: Adding Row Data To Existing Model Instance Question/Problem. Steven_Pinkerton 1 1,360 Aug-09-2022, 10:46 AM
Last Post: Addweb
  Issue in changing data format (2 bytes) into a 16 bit data. GiggsB 11 2,947 Jul-25-2022, 03:19 PM
Last Post: deanhystad
  Adding shifted data set to data set xquad 3 1,633 Dec-22-2021, 10:20 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