mapping the names of groups in a data-frame in pandas
<p>I have a dataframe </p>

<pre><code>df=pd.DataFrame({'name':['a','b','c','a','b','a'],'value':\
   [1,2,3,4,5,6],'value2':[7,8,9,10,11,12]})
</code></pre>

<p>I want to map the columns name to a new list for example:['G','H','F'], so I would get:</p>

<pre><code>df=pd.DataFrame({'name':['G','H','F','G','H','G'],'value':\
   [1,2,3,4,5,6],'value2':[7,8,9,10,11,12]})
</code></pre>

<p>Make a dict:</p>

<pre><code>mapping = {'a':'G', 'b':'H', 'c':'F'}
</code></pre>

<p>Then:</p>

<pre><code>df['name'] = [mapping[item] for item in df['name']]
</code></pre>

python pandas