title: Using OneHotEncoder in making dummy variables
body: <p>I'm trying to make dummy variables in my input set of the following form:
  <a href="https://i.stack.imgur.com/xXTIu.png" rel="nofollow noreferrer">My Input set</a></p>
  
  <p>So I encoded the categorical data so now my array is of the form: <a href="https://i.stack.imgur.com/ZqUJs.png" rel="nofollow noreferrer">Encoded input set</a></p>
  
  <p>Next, I would like to make dummy variables using OneHot Encoder. I know that it used to work this way:</p>
  
  <pre><code>onehotencoder = OneHotEncoder(categorical_features = [1])
  X = onehotencoder.fit_transform(X).toarray()
  </code></pre>
  
  <p>But now the OneHotEncoder class works a bit different and I can't figure out how to adjust it to my dataset so it works exactly this way.
  My code:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  dataset = pd.DataFrame(
      {'RowNumber': [1, 2, 3, 4, 5],
       'CustomerId': [602, 311, 304, 354, 888],
       'Surname': ['Har', 'Hil', 'Oni', 'Bon', 'Mit'],
       'CreditScore': [619, 608, 502, 699, 850],
       'Geography': ['FR', 'ES', 'FR', 'FR', 'ES'],
       'Gender': ['F', 'F', 'F', 'F', 'F'],
       'Age': [42, 41, 42, 39, 43],
       'Tenure': [2, 1, 8, 0, 2]})
  
  X = dataset.iloc[:, 3 : -1].values
  y= dataset.iloc[:, -1].values
  
  # Encoding categorical data
  from sklearn.preprocessing import LabelEncoder
  le = LabelEncoder()
  X[:, 1] = le.fit_transform(X[:, 1])
  X[:, 2] = le.fit_transform(X[:, 2])
  
  # Making dummy variables
  from sklearn.preprocessing import OneHotEncoder
  ohe = OneHotEncoder()
  </code></pre>
  
  <p>Thank you in advance!</p>