Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

create new column using dictionary padnas

U
111
112
112

d = {112: 'a', 111: 'b'}
df['B'] = df['A'].map(d)
df
Out[248]:
     A    B
0  111    a
1  112    b
 
PREVIOUS NEXT
Tagged: #create #column #dictionary #padnas
ADD COMMENT
Topic
Name
7+6 =