title: Calculate medians of data-frame column based on referencing 2 other columns
body: <p>I have a dataframe <code>df</code>:</p>
  <p><code>a = [['A',1,2,3], ['A',0,4,5], ['A',0,6,7],['A',4,6,2],['B',7,3,7],['B',1,6,8],['B',6,2,6],['B',2,5,1],['C',4,2,3],['C',3,9,2],['C',2,7,1],['C',2,3,7]]</code></p>
  <p><code>df = pd.DataFrame(a, columns=['name','one', 'two', 'three'])</code></p>
  <p>that looks like:</p>
  <pre><code>   name  one  two  three
  0     A    1    2      3
  1     A    0    4      5
  2     A    0    6      7
  3     A    4    6      2
  4     B    7    3      7
  5     B    1    6      8
  6     B    6    2      6
  7     B    2    5      1
  8     C    4    2      3
  9     C    3    9      2
  10    C    2    7      1
  11    C    2    3      7
  </code></pre>
  <p>How can I create a new column that is the medians of column <code>three</code> where the <code>name</code> values are the same?  So my desired output would look like:</p>
  <pre><code>   name  one  two  three  median
  0     A    1    2      3     4.0
  1     A    0    4      5     4.0
  2     A    0    6      7     4.0
  3     A    4    6      2     4.0
  4     B    7    3      7     6.5
  5     B    1    6      8     6.5
  6     B    6    2      6     6.5
  7     B    2    5      1     6.5
  8     C    4    2      3     2.5
  9     C    3    9      2     2.5
  10    C    2    7      1     2.5
  11    C    2    3      7     2.5
  </code></pre>
  <p>so for example where <code>name</code> = <code>A</code> the median of 3,5,7 and 2 is calculated to equal 4.0 and entered into the median column where name is equal to <code>A</code>.</p>