title: Change values in pandas dataframe according to value_counts()
body: <p>I have following pandas dataframe :</p>
  
  <pre><code>import pandas as pd 
  from pandas import Series, DataFrame
  
  data = DataFrame({'Qu1': ['apple', 'potato', 'cheese', 'banana', 'cheese', 'banana', 'cheese', 'potato', 'egg'],
                'Qu2': ['sausage', 'banana', 'apple', 'apple', 'apple', 'sausage', 'banana', 'banana', 'banana'],
                'Qu3': ['apple', 'potato', 'sausage', 'cheese', 'cheese', 'potato', 'cheese', 'potato', 'egg']})
  </code></pre>
  
  <p>I'd like to change values in columns <code>Qu1</code>,<code>Qu2</code>,<code>Qu3</code> according to <code>value_counts()</code> when value count great or equal some number</p>
  
  <p>For example for <code>Qu1</code> column </p>
  
  <pre><code>&gt;&gt;&gt; pd.value_counts(data.Qu1) &gt;= 2
  cheese     True
  potato     True
  banana     True
  apple     False
  egg       False
  </code></pre>
  
  <p>I'd like to keep values <code>cheese</code>,<code>potato</code>,<code>banana</code>, because each value has at least two appearances.</p>
  
  <p>From values <code>apple</code> and <code>egg</code> I'd like to create value<code>others</code> </p>
  
  <p>For column <code>Qu2</code> no changes :</p>
  
  <pre><code>&gt;&gt;&gt; pd.value_counts(data.Qu2) &gt;= 2
  banana     True
  apple      True
  sausage    True
  </code></pre>
  
  <p>The final result as in attached <code>test_data</code></p>
  
  <pre><code>test_data = DataFrame({'Qu1': ['other', 'potato', 'cheese', 'banana', 'cheese', 'banana', 'cheese', 'potato', 'other'],
                    'Qu2': ['sausage', 'banana', 'apple', 'apple', 'apple', 'sausage', 'banana', 'banana', 'banana'],
                    'Qu3': ['other', 'potato', 'other', 'cheese', 'cheese', 'potato', 'cheese', 'potato', 'other']})
  </code></pre>
  
  <p>Thanks !</p>