Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

create a dictionary from dataframe

input->
		a      b
0     red  0.500
1  yellow  0.250
2    blue  0.125

dict(df.values)

output -> {'red': '0.500', 'yellow': '0.250', 'blue': '0.125'}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #dictionary #dataframe
ADD COMMENT
Topic
Name
5+7 =