title: How to normalize only certain columns in scikit-learn?
body: <p>I have data similar to the following:</p>
  
  <pre><code>[
     [0, 4, 15]
     [0, 3, 7]
     [1, 5, 9]
     [2, 4, 15]
  ]
  </code></pre>
  
  <p>I used <code>oneHotEncoder</code> <a href="http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html#sklearn.preprocessing.OneHotEncoder.fit_transform" rel="noreferrer">http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html#sklearn.preprocessing.OneHotEncoder.fit_transform</a> to preprocess this data so it is suitable for linear regression to give me this:</p>
  
  <pre><code>[
     [1, 0, 0, 4, 15]
     [1, 0, 0, 3, 7]
     [0, 1, 0, 5, 9]
     [0, 0, 1, 4, 15]
  ]
  </code></pre>
  
  <p>However, I then wish to normalise this data.</p>
  
  <p>So far I am just normalising the data like so:</p>
  
  <pre><code>preprocessing.normalize(data)
  </code></pre>
  
  <p>However, this normalises all the columns including category ones. </p>
  
  <p>My questions are the following:</p>
  
  <ul>
  <li>How do I normalise only certain columns?</li>
  <li>Is it desirable to normalise category data, or should I avoid it?</li>
  </ul>
  
  <p>Thank you!</p>