title: Filling a default value if count is less than threshold in pandas
body: <p>I have a dataframe:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  df = pd.DataFrame()
  df['name'] = ['john','sam','john','john','dean','dean','maggi',
                'ram','maggi','ana','sam','sam']
  df['pt'] = [23, 32, 45, 65, 65, 45, 32, 45, 90, 10, 32, 22]
  </code></pre>
  
  <p>I want to replace a name by other if name appears only once in name column.</p>
  
  <p>So my output would be:</p>
  
  <pre><code>     name  pt
  0    john  23
  1     sam  32
  2    john  45
  3    john  65
  4    dean  65
  5    dean  45
  6   maggi  32
  7   other  45
  8   maggi  90
  9   other  10
  10    sam  32
  11    sam  22
  </code></pre>
  
  <p>In my original data, values are in hundreds so using
  <code>df.replace</code> or <code>map</code> is not feasible. </p>
  
  <p><code>np.where</code> works only with binary column. So I'm stuck here.</p>
  
  <p>Thanks,</p>