title: ValueError: Shape mismatch: if categories is an array, it has to be of shape (n_features,)
body: <p>I have create a simple code to implement <code>OneHotEncoder</code>. </p>
  
  <pre><code>from sklearn.preprocessing import OneHotEncoder
  X = [[0, 'a'], [0, 'b'], [1, 'a'], [2, 'b']]
  onehotencoder = OneHotEncoder(categories=[0])
  X = onehotencoder.fit_transform(X).toarray()
  </code></pre>
  
  <p>I just want to use method called <code>fit_transform</code> to the <code>X</code> for index <code>0</code>, so it means for <code>[0, 0, 1, 2]</code> like what you see in <code>X</code>. But it causes an error like this : </p>
  
  <p><code>ValueError: Shape mismatch: if categories is an array, it has to be of shape (n_features,).</code></p>
  
  <p>Anyone can solve this problem ? I am stuck on it </p>