title: Performing a median split on a pandas dataframe
body: <p>I have a df with the following structure:</p>
  <pre><code>    df = pd.DataFrame({'varb': ['0.56', '0.74', '0.89', '0.99', '0.24', '0.76', '0.60'], 
                 'response': ['141', '134', '72', '29', '34', '50', '128'],
                 })
  df
  </code></pre>
  <p>I want to perform a <em>median split</em> on 'varb' and have the top 50th percentile be put in group '2' and the bottom 50th percentile be put in group '1' so the resulting dataframe would look like this:</p>
  <pre><code>df = pd.DataFrame({'varb': ['0.56', '0.74', '0.89', '0.99', '0.24', '0.76', '0.60'], 
                 'response': ['141', '134', '72', '29', '34', '50', '128'],
                 'median_split': ['2', '2', '2', '1', '1', '1', '2']})
  df
  </code></pre>
  <p>How can I achieve this using python?</p>