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
#11
if you are trying to index the lists, they must have some sort of order, otherwise how would you be able to do indexing?
If you can't define it mathematically, then you won't be able to index. If there is some sort of consistent order, then indexing will work.

I suggest you try to run the two examples by themselves, verbatim so that you can play with the ordering mechanism, then apply to you actual code.

I forgot to mention this before, but it's important: There is still an ellipsis at the end of the data list that must be removed.
Reply


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,276 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,644 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,885 Aug-11-2021, 03:45 PM
Last Post: jamesaarr
  Better way to append frames from a video to multiple lists? Balaganesh 0 1,879 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