Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

use a dictionary to make a column of values

df['col1'].map(di)       # note: if the dictionary does not exhaustively map all
                         # entries then non-matched entries are changed to NaNs
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dictionary #column #values
ADD COMMENT
Topic
Name
2+4 =