title: Feature preprocessing of both continuous and categorical variables (of integer type) with scikit-learn
body: <p>The main goals are as follows:</p>
  <ol>
  <li><p>Apply <code>StandardScaler</code> to continuous variables</p>
  </li>
  <li><p>Apply <code>LabelEncoder</code> and <code>OnehotEncoder</code> to categorical variables</p>
  </li>
  </ol>
  <p>The continuous variables need to be scaled, but at the same time, a couple of categorical variables are also of integer type. Applying <code>StandardScaler</code> would result in undesired effects.</p>
  <p>On the flip side, the <code>StandardScaler</code> would scale the integer based categorical variables, which is also not what we want.</p>
  <p>Since continuous variables and categorical ones are mixed in a single <code>Pandas</code> DataFrame, what's the recommended workflow to approach this kind of problem?</p>
  <p>The best example to illustrate my point is the <a href="https://www.kaggle.com/c/bike-sharing-demand/data" rel="noreferrer">Kaggle Bike Sharing Demand</a> dataset, where <code>season</code> and <code>weather</code> are integer categorical variables</p>