title: LabelEncoding large amounts of categorical data
body: <p>I have a dataset with 39 categorical and 27 numerical features. I am trying to encode the categorical data and need to be able to inverse transform and call transform for each column again. Is there a prettier way of doing it than defining 39 separate LabelEncoder instances, and then fit_transform to each column individually?</p>
  <p>I feel like I am missing something obvious, but I cant figure it out!</p>
  <pre><code>enc = LabelEncoder
  cat_feat = [col for col in input_df2.columns if input_df2[col].dtype == 'object']
  cat_feat = np.asarray(cat_feat)
  
  le1 =LabelEncoder()
  le2 =LabelEncoder()
  le3 =LabelEncoder()
  ...
  #extended to le39
  
  def label(input):
         input.iloc[:, 1] = le1.fit_transform(input.iloc[:, 1])
         input.iloc[:, 3] = le1.fit_transform(input.iloc[:, 3])
         input.iloc[:, 4] = le1.fit_transform(input.iloc[:, 4])
         ... 
         return input
  </code></pre>