title: AxisError: axis -1 is out of bounds for array of dimension 0
body: <p>I'm trying to implement One Hot Encoding on selected Categorical columns</p>
  <pre><code>mask = df.columns.isin(['cp','restecg','slope','thal'])[:-1]
  </code></pre>
  <p>After applying One Hot Encoding like this:</p>
  <pre><code>enc = OneHotEncoder(categories=mask, sparse=False)
  </code></pre>
  <p>and instantiate fit like this:</p>
  <pre><code>enc.fit(X_train)
  </code></pre>
  <p>I'm getting this error</p>
  <pre><code>axis -1 is out of bounds for array of dimension 0
  </code></pre>
  <p>So I searched many places, to what I'm doing wrong, some mentioned that calling OneHotEncoding directly will not work, so I tried this:</p>
  <pre><code>from sklearn.compose import ColumnTransformer
  enc = ColumnTransformer([(mask, OneHotEncoder())], 
  sparse_threshold=False)
  </code></pre>
  <p>After this, I tried to fit in again like this:</p>
  <pre><code>enc.fit(X_train)
  </code></pre>
  <p>Now, I'm getting this error:</p>
  <pre><code>ValueError: not enough values to unpack (expected 3, got 2)
  </code></pre>
  <p>What am I doing wrong?</p>