In a very old post - Label Encoder vs. One Hot Encoder in Machine Learning - I had demonstrated how...
python onehotencoder
Update: SciKit has a new library called the ColumnTransformer which has replaced LabelEncoding. You can check out this updated post...