title: In pandas, how to create a new column with a rank according to the mean values of another column
body: <p>I have the following pandas dataframe</p>
  
  <pre><code>+---------+-------+
  | Country | value |
  +---------+-------+
  | UK      |    42 |
  | US      |     9 |
  | US      |    10 |
  | France  |    15 |
  | France  |    16 |
  | Germany |    17 |
  | Germany |    18 |
  | Germany |    20 |
  +---------+-------+
  </code></pre>
  
  <p>I want to create a new column that ranks each of the countries according to the mean of their values from largest to smallest</p>
  
  <p>The output would look like the following</p>
  
  <pre><code>+---------+-------+---------+------+
  | Country | value | Average | Rank |
  +---------+-------+---------+------+
  | UK      |    42 |      42 |    1 |
  | US      |     9 |     9.5 |    4 |
  | US      |    10 |     9.5 |    4 |
  | France  |    15 |    15.5 |    3 |
  | France  |    16 |    15.5 |    3 |
  | Germany |    17 |      18 |    2 |
  | Germany |    18 |      18 |    2 |
  | Germany |    20 |      18 |    2 |
  +---------+-------+---------+------+
  </code></pre>
  
  <p>Note that I don't need the average column, its just there to help with the explanation.</p>
  
  <p>Many thanks</p>