title: Python Pandas AttributeError: 'Series' object has no attribute 'columns'
body: <p>This code :</p>
  
  <pre><code>import pandas as pd
  
  data = pd.read_csv('house', sep="\t", header=None)
  data.columns = ['label', 'msg']
  data['msg_length'] = data['msg'].apply(lambda x: len(x))
  data['msg'].hist(column =data['msg_length'], by=data['label'], bins=50)
  </code></pre>
  
  <p>Gives me this error:</p>
  
  <p>AttributeError: 'Series' object has no attribute 'columns'
  ` </p>
  
  <p>I have tried different things with pd.DataFrame and pd.Series, without luck.
  What do i wrong?</p>
  
  <p>Result of pd.read_csv:
  <a href="https://i.stack.imgur.com/EsshW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EsshW.png" alt="enter image description here"></a></p>
  
  <p>Expected output:
  <a href="https://i.stack.imgur.com/g6AXT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g6AXT.png" alt="enter image description here"></a></p>
  
  <p>Error code:</p>
  
  <p><a href="https://i.stack.imgur.com/Oo6te.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Oo6te.png" alt="enter image description here"></a></p>