. Поместите панды для петли
df_media_input['MediaChannel'].replace(replacements, inplace=True)
Successful Sable
df_media_input['MediaChannel'].replace(replacements, inplace=True)
replacements = {
"Direct Mail": "DM",
"DR TV": "DRTV",
# and so on...
}
df_media_input['MediaChannel'].replace(replacements, inplace=True)