title: How do I change column type in Python from int to object for sklearn?
body: <p>I am really new to Python and scikit-learn (sklearn) and I am trying to load this dataset which consists of 7 columns of attributes and 1 column of the data classification (class/data target). But there's this one attribute which consists of data [1,2,3,4,5] which actually marks a stage of something, thus making it a nominal, not numeric. But of course python recognizes it as a numerical data (int64), when in fact I want it to be treated as a nominal data (object). How do I change the column type to nominal?</p>
  
  <p>I have done the following.</p>
  
  <pre><code>print(data.dtypes)
  data["col_name"]=data["col_name"].astype(numpy.object)
  print(data.dtypes)
  </code></pre>
  
  <p>In the first print, it still recognizes my data["col_name"] as an int64, but after the <code>astype</code> line, it has changed it <code>object</code>. But it doesn't make any difference to the data, since when I try to use <code>matplotlib</code> and create a histogram, it still recognizes both the X and Y as numbers instead of object.</p>
  
  <p>Also I have read about the <code>One Hot Encoding</code> and <code>Label Encoding</code> on the documentation, but I figured they are not what I need in my case. I wonder if I have misunderstood something or maybe there's another solution.</p>
  
  <p>Thanks</p>