Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas map multiple columns

col_map = pd.Series(df.col1.values,index=df.col2).to_dict()
df['col1'] = df['col2'].map(col_map)
 
PREVIOUS NEXT
Tagged: #pandas #map #multiple #columns
ADD COMMENT
Topic
Name
6+6 =