title: AttributeError: Can only use .str accessor with string values
body: <p>This is not a dupe! I've been through all related questions and they don't answer my problem.</p>
  <p>I'm using standard method for stripping spaces from pandas string columns as explained <a href="https://stackoverflow.com/a/40950485/2119941">here</a>:</p>
  <pre><code>df_obj = df.select_dtypes(['object'])
  df[df_obj.columns] = df_obj.apply(lambda x: x.str.strip())
  </code></pre>
  <p>But keep getting:</p>
  <blockquote>
  <p>c:\users\user\appdata\local\programs\python\python37\lib\site-packages\pandas\core\strings.py
  in _validate(data)    if inferred_dtype not in
  allowed_types: raise AttributeError(&quot;Can only use .str accessor with string values!&quot;)<br />
  return inferred_dtype</p>
  <p>AttributeError: Can only use .str accessor with string values!</p>
  </blockquote>
  <p>And when I run <code>print(df_obj .dtypes)</code> I get all columns listed as '<code>object</code>'.
  So what's the problem?</p>
  <p>Pandas version: '1.1.4'</p>