title: IndexError: index 2 is out of bounds for axis 1 with size 2 in Sklearn LabelEncoder
body: <p>I've been trying to create a DL model for a practice purpose using ANN. I've a fake bank's customer data in which there are two categorical variable i.e gender and country.</p>
  
  <p>I tried to encode country variable but got below error which I don't have with the gender variable.</p>
  
  <p>Error:</p>
  
  <blockquote>
    <p>X[:, 2] = labelencoder_X_2.fit_transform(X[:, 2])
    IndexError: index 2 is out of bounds for axis 1 with size 2</p>
  </blockquote>
  
  <p>My Code:</p>
  
  <pre><code>dataframe = pd.read_csv('.\Artificial_Neural_Networks\Churn_Modelling.csv')
  X = dataframe.iloc[:, [3, 13]].values
  Y = dataframe.iloc[:, -1].values
  
  # Encodeing categorical data
  # for country column
  labelencoder_X_1 = LabelEncoder()
  X[:, 1] = labelencoder_X_1.fit_transform(X[:, 1])
  # print(X)
  
  # for gender column
  labelencoder_X_2 = LabelEncoder()
  X[:, 2] = labelencoder_X_2.fit_transform(X[:, 2])
  print(X)
  </code></pre>
  
  <p>P.S: I use Pycharm and novice in Deep Learning.</p>
  
  <p>Thanks in Advance</p>