title: Python One Hot Encoder: 'PandasArray' object has no attribute 'reshape'
body: <p>I have the following program:</p>
  
  <pre><code>cat_feats = ['x', 'y', 'z', 'a', 'b',
                  'c', 'd', 'e']
  
  onehot_encoder = OneHotEncoder(categories='auto')
  # convert each categorical feature from integer
  # to one-hot
  for feature in cat_feats:
      data[feature] = data[feature].array.reshape(len(data[feature]), 1)
      data[feature] = onehot_encoder.fit_transform(data[feature])
  </code></pre>
  
  <p>I am having issues with this. I get:</p>
  
  <pre><code>'PandasArray' object has no attribute 'reshape'
  </code></pre>
  
  <p>The output of data.head() before using the encoder is this:</p>
  
  <pre><code> 0          2          1               4           6             3     2       1              37
   2          1          7               2          10             0     4       1              37
   3          2         15               2           6             0     2       1              37
   5          2          0               4           7             1     4       1              37
   7          4         14               2           9             0     4       1              37
  </code></pre>
  
  <p>This output is of type DataFrame and contains only integers which I am trying to convert to one-hot. I have tried .array, .values, .array.reshape(-1, 1), but none of these things are working. I found that trying .values seemed to work in the first line of the for loop, but I got garbage from my one-hot conversion.</p>
  
  <p>Please help.</p>