title: Replace keywords in dataframe column using pandas dictionary
body: <p>I have a dataframe that contain 4 columns, one of them is called action_description, it contain "free text" that resume the different actions done to resolve an issue.</p>
  
  <p>The words in this column are sometimes miswritting, and we have a dictionnary, for all famous miswords (example: REPLCD -> REPLACED, .....)</p>
  
  <p>I want to replace all miswords in my column using python code.</p>
  
  <p>Here's the code I use: </p>
  
  <p>Code:</p>
  
  <pre><code>import sys
  import pyspark
  import pandas_datareader
  import re
  import csv
  import xlrd
  import pandas as pd
  import numpy as np
  import datetime
  
  from pyspark.context import SparkContext
  from pyspark.sql.functions import *
  from pandas import DataFrame
  from pandas_datareader import data, wb
  from pandas import *
  
  xls = ExcelFile("test_doc_2.xls")
  df = xls.parse(xls.sheet_names[0])
  df.drop(df.columns[[0, 1]],inplace=True,axis=1)
  df2 = Series(df.TO_VALUE.values,index=df.FROM_VALUE).to_dict()
  
  xls1 = ExcelFile("Test_Source_New_2.xls")
  df1 = xls1.parse(xls1.sheet_names[0])
  
  df1['WORK_PERFORMED_NEW'] = df1['WORK_PERFORMED'].replace(df2, regex=True)
  </code></pre>
  
  <p>This solution work, except in some cases, </p>
  
  <p>in my dictionary: DEF -> DEFERRED, DEFERED -> DEFERRED</p>
  
  <p>so with my solution: DEFERED -> DEFERREDERED, at it replaced DEF in DEFERED by DEFERRED and it got concatenated with ERED, DEFERRED+ERED.</p>
  
  <p>I thought about using boundaries (r"\b"), but I got syntax error !!!</p>
  
  <p>How can I overcome this issue .</p>
  
  <p>Thank you in advance.</p>