Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to convert multi list to dict

# Your Data list

names = ["john", "paul", "george", "ringo"]
job = ["guitar", "bass", "guitar", "drums"]
status = ["dead", "alive", "dead", "alive"]

dict_data = [{'name': name, 'job': job, 'status': status} for name,job,status in zip(names,jobs,statuses)]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #multi #list #dict
ADD COMMENT
Topic
Name
5+7 =