title: Python dataframe group by column and create new column with percentage
body: <p>I have a scenario simulating to a dataframe which looks something like below:</p>
  
  <pre><code>    Month  Amount  
  1   Jan     260
  2   Feb    179
  3   Mar    153
  4   Apr    142
  5   May    128
  6   Jun    116
  7   Jul    71
  8   Aug    56
  9   Sep    49
  10  Oct    17
  11  Nov    0
  12  Dec    0
  </code></pre>
  
  <p>I'm trying to get new column by calculating percentage for each row using dataframe group by and use lambda function as below:</p>
  
  <pre><code> df = pd.DataFrame(mylistofdict)
   df = df.groupby('Month')["Amount"].apply(lambda x: x / x.sum()*100)
  </code></pre>
  
  <p>But I'm not getting the expected result below only 2 columns:    </p>
  
  <pre><code>    Month   Percentage
  1   Jan         22%
  2   Feb         15%
  3   Mar         13%
  4   Apr         12%
  5   May         11%
  6   Jun         10%
  7   Jul         6%
  8   Aug         5%
  9   Sep         4%
  10  Oct         1%
  11  Nov         0
  12  Dec         0
  </code></pre>
  
  <p>How do i modify my code or is there anything better than use dataframe.</p>