title: Linear regression analysis with string/categorical features (variables)?
body: <p>Regression algorithms seem to be working on features represented as numbers. 
  For example:</p>
  
  <p><a href="https://i.stack.imgur.com/deFE1.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/deFE1.jpg" alt="simple data without categorical features"></a></p>
  
  <p>This data set doesn't contain categorical features/variables. It's quite clear how to do regression on this data and predict price.</p>
  
  <hr>
  
  <p>But now I want to do a regression analysis on data that contain categorical features:</p>
  
  <p><a href="https://i.stack.imgur.com/gLRrh.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/gLRrh.jpg" alt="data-set with categorical features"></a></p>
  
  <p>There are <strong>5</strong> features: <code>District</code>, <code>Condition</code>, <code>Material</code>, <code>Security</code>, <code>Type</code></p>
  
  <hr>
  
  <p>How can I do a regression on this data? Do I have to transform all the string/categorical data to numbers manually? I mean if I have to create some encoding rules and according to that rules transform all data to numeric values. </p>
  
  <p>Is there any simple way to transform string data to numbers without having to create my own encoding rules manually? Maybe there are some libraries in <strong>Python</strong> that can be used for that? Are there some risks that the regression model will be somehow incorrect due to "bad encoding"?</p>