Python Forum
Searching through a list of dictionaries with a condition.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Searching through a list of dictionaries with a condition.
#5
Hey apologies for late reply, I'm not getting email alerts. I'm going to try what you said, although I'd like to point out why I created the second loop. It's because I don't know what the syntax is to access a particular key in a list of dictionaries.
For example, I know that there is the syntax:
arrayofDict[0]['key']
But this will hone in on only the first element of the list and won't grant access to all the dictionaries in the list. I'm trying to cycle through the list of dictionaries and print out the key-value of a particular key.
Reply


Messages In This Thread
RE: Searching through a list of dictionaries with a condition. - by Mr_Keystrokes - Oct-01-2018, 07:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sort a list of dictionaries by the only dictionary key Calab 2 690 Apr-29-2024, 04:38 PM
Last Post: Calab
  unable to remove all elements from list based on a condition sg_python 3 529 Jan-27-2024, 04:03 PM
Last Post: deanhystad
  Access list of dictionaries britesc 4 1,162 Jul-26-2023, 05:00 AM
Last Post: Pedroski55
  select Eof extension files based on text list of filenames with if condition RolanRoll 1 1,574 Apr-04-2022, 09:29 PM
Last Post: Larz60+
  Searching in the list quest 4 1,597 Mar-02-2022, 10:30 AM
Last Post: quest
  function that returns a list of dictionaries nostradamus64 2 1,826 May-06-2021, 09:58 PM
Last Post: nostradamus64
  convert List with dictionaries to a single dictionary iamaghost 3 2,919 Jan-22-2021, 03:56 PM
Last Post: iamaghost
  Creating a list of dictionaries while iterating pythonnewbie138 6 3,360 Sep-27-2020, 08:23 PM
Last Post: pythonnewbie138
  Help accessing elements of list of dictionaries Milfredo 6 2,942 Sep-07-2020, 01:32 AM
Last Post: Milfredo
  Accessing values in list of dictionaries pythonnewbie138 2 2,189 Aug-02-2020, 05:02 PM
Last Post: pythonnewbie138

Forum Jump:

User Panel Messages

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