Python Forum
Create Dict from multiple Lists with duplicate Keys
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create Dict from multiple Lists with duplicate Keys
#7
Please don't quote previous posts (unless necessary) , it makes individual posts difficult to read.

The lists are of unequal length.
I put: print(f"List lengths, desigName: {len(desigName)}, creatorName: {len(creatorName)}, fabric_names: {len(fabric_names)}, data: {len(data)}\n")
in the code after lists were defined, and here's the results:
Output:
List lengths, desigName: 84, creatorName: 84, fabric_names: 24, data: 48
the first three lists are expected to be the same size.
the data list can be longer (in first example only) as the proper entry is searched for, but there must be an entry for each corresponding design name.
If second example is used, all lists are expected to be the same size (number of entries)
(as presented in post 1)
this code is dependant on that.
Reply


Messages In This Thread
RE: Create Dict from multiple Lists with duplicate Keys - by Larz60+ - Jun-26-2021, 01:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python convert multiple files to multiple lists MCL169 6 1,681 Nov-25-2023, 05:31 AM
Last Post: Iqratech
  Find duplicate files in multiple directories Pavel_47 9 3,278 Dec-27-2022, 04:47 PM
Last Post: deanhystad
  Create multiple/single csv file for each sql records mg24 6 1,493 Sep-29-2022, 08:06 AM
Last Post: buran
  Updating nested dict list keys tbaror 2 1,317 Feb-09-2022, 09:37 AM
Last Post: tbaror
  Loop Dict with inconsistent Keys Personne 1 1,645 Feb-05-2022, 03:19 AM
Last Post: Larz60+
  Generate a string of words for multiple lists of words in txt files in order. AnicraftPlayz 2 2,886 Aug-11-2021, 03:45 PM
Last Post: jamesaarr
  Better way to append frames from a video to multiple lists? Balaganesh 0 1,882 May-13-2021, 07:37 AM
Last Post: Balaganesh
  Xlsxwriter: Create Multiple Sheets Based on Dataframe's Sorted Values KMV 2 3,567 Mar-09-2021, 12:24 PM
Last Post: KMV
Question How to print multiple elements from multiple lists in a FOR loop? Gilush 6 3,037 Dec-02-2020, 07:50 AM
Last Post: Gilush
  Create a sequential number (counter) and reset at each duplicate Mekala 0 1,768 Sep-20-2020, 05:02 AM
Last Post: Mekala

Forum Jump:

User Panel Messages

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