Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to create dictionary between two columns in python

1
2
3
4
5
6
7
dict(zip(df.state, df.name))
 
{'AK': 'Alaska',
 'AL': 'Alabama',
 'AR': 'Arkansas',
 'AZ': 'Arizona',
 'CA': 'California'}
Source by cmdlinetips.com #
 
PREVIOUS NEXT
Tagged: #create #dictionary #columns #python
ADD COMMENT
Topic
Name
7+8 =