Python Forum
How to make a list of values from a dictionary list?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a list of values from a dictionary list?
#3
(Sep-03-2020, 02:15 PM)DeaD_EyE Wrote: Iterate over the elements, access the key "X" and append it to a new list.

results = []
for element in L:
    ...
    # this is your task
https://docs.python.org/3/tutorial/datas...e-on-lists
https://docs.python.org/3/tutorial/datas...ctionaries

PS: L is a bad name.

Thank you very much for your kind answer!
Reply


Messages In This Thread
RE: How to make a list of values from a dictionary list? - by faryad13 - Sep-03-2020, 03:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Replace values in Yaml file with value in dictionary PelleH 0 120 Jun-12-2024, 02:40 PM
Last Post: PelleH
  remove duplicates from dicts with list values wardancer84 27 1,054 May-27-2024, 04:54 PM
Last Post: wardancer84
  Strange behavior list of list mmhmjanssen 3 506 May-09-2024, 11:32 AM
Last Post: mmhmjanssen
  Sort a list of dictionaries by the only dictionary key Calab 2 764 Apr-29-2024, 04:38 PM
Last Post: Calab
Question Using Lists as Dictionary Values bfallert 8 653 Apr-21-2024, 06:55 AM
Last Post: Pedroski55
  Dictionary in a list bashage 2 686 Dec-27-2023, 04:04 PM
Last Post: deanhystad
  filtering a list of dictionary as per given criteria jss 5 857 Dec-23-2023, 08:47 AM
Last Post: Gribouillis
  need to compare 2 values in a nested dictionary jss 2 997 Nov-30-2023, 03:17 PM
Last Post: Pedroski55
  Copying the order of another list with identical values gohanhango 7 1,340 Nov-29-2023, 09:17 PM
Last Post: Pedroski55
  Search Excel File with a list of values huzzug 4 1,419 Nov-03-2023, 05:35 PM
Last Post: huzzug

Forum Jump:

User Panel Messages

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