title: Applying Regex across entire column of a Dataframe
body: <p>I have a Dataframe with 3 columns:</p>
  
  <pre><code>id,name,team 
  101,kevin, marketing
  102,scott,admin\n
  103,peter,finance\n
  </code></pre>
  
  <p>I am trying to apply a regex function such that I remove the unnecessary spaces. I have got the code that removes these spaces how ever I am unable loop it through the entire Dataframe.</p>
  
  <p>This is what I have tried thus far:</p>
  
  <pre><code>df['team'] = re.sub(r'[\n\r]*','',df['team'])
  </code></pre>
  
  <p>But this throws an error <code>AttributeError: 'Series' object has no attribute 're'</code></p>
  
  <p>Could anyone advice how could I loop this regex through the entire Dataframe <code>df['team']</code> column</p>