Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

.replace pandas in for loop



replacements = {
    "Direct Mail": "DM",
    "DR TV": "DRTV",
    # and so on...
}

df_media_input['MediaChannel'].replace(replacements, inplace=True)


Source by nullorempty.org #
 
PREVIOUS NEXT
Tagged: #pandas #loop
ADD COMMENT
Topic
Name
6+3 =