title: How to replace values with substrings in pandas objects?
body: <p>I have coordinates in a Latitude dataset that each end with a letter (ex. N).</p>
  
  <p>What is the best way to retrieve only the numbers and replace the original values?</p>
  
  <p>My attempt at this was:</p>
  
  <pre><code>raw['LATITUDE'] = raw.loc[(raw['LATITUDE'].str.len() == 9)].str[0:8]
  </code></pre>
  
  <p>But I get an AttributeError message.</p>
  
  <pre><code>AttributeError: 'DataFrame' object has no attribute 'str'
  </code></pre>
  
  <p>I also tried replacing the values with regex but I wasn't sure how to make it successful.</p>
  
  <p>I'd appreciate any suggestions, thank you.</p>
  
  <p><a href="https://i.stack.imgur.com/UJbvg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UJbvg.jpg" alt="enter image description here"></a></p>