title: TypeError: expected string or bytes-like object pandas variable
body: <p>I have dataset like this</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({'word': ['abs e learning ', 'abs e-learning', 'abs e&amp;learning', 'abs elearning']})
  </code></pre>
  
  <p>I want to get  </p>
  
  <pre><code>      word
  0   abs elearning
  1   abs elearning
  2   abs elearning
  3   abs elearning
  </code></pre>
  
  <p>I do as bellow</p>
  
  <pre><code>re_map = {r'\be learning\b': 'elearning', r'\be-learning\b': 'elearning', r'\be&amp;learning\b': 'elearning'}
  import re
  for r, map in re_map.items():
              df['word'] = re.sub(r, map, df['word'])
  </code></pre>
  
  <p>and error</p>
  
  <pre><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-42-fbf00d9a0cba&gt; in &lt;module&gt;()
        3 s = df['word']
        4 for r, map in re_map.items():
  ----&gt; 5             df['word'] = re.sub(r, map, df['word'])
  
  C:\Users\Edward\Anaconda3\lib\re.py in sub(pattern, repl, string, count, flags)
      180     a callable, it's passed the match object and must return
      181     a replacement string to be used."""
  --&gt; 182     return _compile(pattern, flags).sub(repl, string, count)
      183 
      184 def subn(pattern, repl, string, count=0, flags=0):
  
  TypeError: expected string or bytes-like object
  </code></pre>
  
  <p>I can apply str like this</p>
  
  <pre><code>for r, map in re_map.items():
              df['word'] = re.sub(r, map, str(df['word']))
  </code></pre>
  
  <p>There is no mistake but i cann't get pd.dataFrame as i wish</p>
  
  <pre><code>    word
  0   0 0 0 abs elearning \n1 abs elearning\...\n1 0 0 abs elearning \n1 abs elearning\...\n2 0 0 abs elearning \n1 abs ele...
  1   0 0 0 abs elearning \n1 abs elearning\...\n1 0 0 abs elearning \n1 abs elearning\...\n2 0 0 abs elearning \n1 abs ele...
  2   0 0 0 abs elearning \n1 abs elearning\...\n1 0 0 abs elearning \n1 abs elearning\...\n2 0 0 abs elearning \n1 abs ele...
  3   0 0 0 abs elearning \n1 abs elearning\...\n1 0 0 abs elearning \n1 abs elearning\...\n2 0 0 abs elearning \n1 abs ele...
  </code></pre>
  
  <p>how to improve it?</p>