title: How to remake this code for dataframe mapping properly
body: <pre><code>titset[&quot;Sex&quot;] = titset[&quot;Sex&quot;].map({&quot;male&quot;: 2, &quot;female&quot;: 1})
  titset[&quot;Embarked&quot;] = titset[&quot;Embarked&quot;].map({&quot;S&quot;: 1, &quot;C&quot;: 2, 'Q' : 3})
  </code></pre>
  <p>I had such code but i was told that i can't use it because it have been already used so i'm confused how to remake it remake it to have the same functionality as it has. It changes 'male' in Sex column and 'female' values on 2 and 1, and on 'Embarked' column in replaces 'S' with 1 etc</p>