title: How to replace categorical variables with its numerical representations for further calculating their correlations?
body: <ol>
  <li>I have a data-frame with information about different users (ID) with many duplicated categorical variables (photo and hash-tags) and its corresponding numbers of interactions (likes and comments). How i can replace categorical variables with its numeric transformations? </li>
  </ol>
  
  <p>For example:</p>
  
  <pre><code>id    photo_type    likes comments   hash-tags
  
  1     nature          2      1        [#nature, #shooting, #photography]
  
  2     art             4      5        [#shooting, #photography]
  
  3     art             1      3        [#art, #shooting]
  
  4     fashion         3      0        [#beauty, #photography]
  
  5     fashion         2      0        [#shooting, #photography]
  </code></pre>
  
  <p>I expect to get:</p>
  
  <pre><code>id    photo_type    likes  hash-tags
  
  1     0 0 1           2      ?
  
  2     0 1 0           4      ?
  
  3     0 1 0           1      ?
  
  4     1 0 0           3      ?
  
  5     1 0 0           2      ?
  </code></pre>
  
  <p>I have tried one-hot (get_dummies(photo_type)), but it adds more numerical columns to my dataframe, what i want is to replace the categorical column with its numerical transformation for photo type. </p>