title: How to apply label encoding uniformly in all columns?
body: <p>I have a dataset of which I have attached an image.<a href="https://i.stack.imgur.com/iuXF6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iuXF6.png" alt="Dataset" /></a></p>
  <p>The set of unique values in Origin and Dest are same. Upon doing label encoding of those columns, I thought that value ATL will get same encoding in 'Origin' and 'Dest' but it turns out that the given code:</p>
  <pre><code>label_encoder = LabelEncoder()
  flight_f['UniqueCarrier'] = label_encoder.fit_transform(flight_f['UniqueCarrier'])
  flight_f['Origin'] = label_encoder.fit_transform(flight_f['Origin'])
  flight_f['Dest'] = label_encoder.fit_transform(flight_f['Dest'])
  </code></pre>
  <p>Gives different encoding to a particular value in the two columns. And this is just the training set. I think in test set, I might get different values too which will hamper the predicitive analysis.</p>
  <p>Can anyone suggest a solution, please?</p>