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,534 Nov-25-2023, 05:31 AM
Last Post: Iqratech
  Find duplicate files in multiple directories Pavel_47 9 3,073 Dec-27-2022, 04:47 PM
Last Post: deanhystad
  Create multiple/single csv file for each sql records mg24 6 1,387 Sep-29-2022, 08:06 AM
Last Post: buran
  Updating nested dict list keys tbaror 2 1,275 Feb-09-2022, 09:37 AM
Last Post: tbaror
  Loop Dict with inconsistent Keys Personne 1 1,603 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,792 Aug-11-2021, 03:45 PM
Last Post: jamesaarr
  Better way to append frames from a video to multiple lists? Balaganesh 0 1,839 May-13-2021, 07:37 AM
Last Post: Balaganesh
  Xlsxwriter: Create Multiple Sheets Based on Dataframe's Sorted Values KMV 2 3,483 Mar-09-2021, 12:24 PM
Last Post: KMV
Question How to print multiple elements from multiple lists in a FOR loop? Gilush 6 2,927 Dec-02-2020, 07:50 AM
Last Post: Gilush
  Create a sequential number (counter) and reset at each duplicate Mekala 0 1,730 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