title: Python pandas functions work in shell not in script
body: <p>I have a pandas dataframe in which I'm trying to run some operations on a column of string values which includes some missing data being interpreted as <code>float('nan')</code>, equivalent to:</p>
  
  <pre><code>df = pd.DataFrame({'otherData':[1,2,3,4],'stringColumn':[float('nan'),'Random string one... ','another string..  ','a third string    ']})
  </code></pre>
  
  <p><br><strong><code>DataFrame</code> contents:</strong></p>
  
  <pre><code>otherData    stringColumn
  1            nan
  2            'Random string one... '
  3            'another string..  '
  4            ' a third string    '
  </code></pre>
  
  <p>I want to clean the <code>stringColumn</code> data of the various trailing ellipses and whitespace, and impute empty strings, i.e. <code>''</code>, for <code>nan</code> values.</p>
  
  <p>To do this, I'm using code equivalent to: </p>
  
  <pre><code>df['stringColumn'] = df['stringColumn'].fillna('')
  df['stringColumn'] = df['stringColumn'].str.strip()
  df['stringColumn'] = df['stringColumn'].str.strip('...')
  df['stringColumn'] = df['stringColumn'].str.strip('..')
  </code></pre>
  
  <p>The problem I'm encountering is that when I run this code in the script I've written, it doesn't work. There are still <code>nan</code> values in my 'stringColumn' column, and there are still some, but not all, ellipses. There are no warning messages. However, when I run the exact same code in the python shell, it works, imputing <code>''</code> for <code>nan</code>, and cleaning up as desired. I've tried running it in IDLE 3.5.0 and Spyder 3.2.4, with the same result.</p>