Pluck values from list of dictionaries
Converts a list of dictionaries into a list of values corresponding to the specified key
.
- Use a list comprehension and
dict.get()
to get the value ofkey
for each dictionary inlst
.
Converts a list of dictionaries into a list of values corresponding to the specified key
.
dict.get()
to get the value of key
for each dictionary in lst
.