Python Map List of Strings to Integer List
<p>Let's say I have a list</p>

<pre><code>l = ['michael','michael','alice','carter']
</code></pre>

<p>I want to map it to the following:</p>

<pre><code>k = [1,1,2,3]
</code></pre>

<p>Where michael corresponds to 1, alice corresponds to 2 etc. Is there a function in Python to do this easily?</p>
