title: dividing columns by 99th percentile in pandas
body: <p>i have a table in pandas dataframe.
  df</p>
  
  <pre><code>LeafId  pidx    pidy    count    value
  1       10      20       2         5
  1       10      35       10        10
  1       10      26       30        15
  1       10      40       11        20
  1       15      20       25        25
  1       30      70       12        30
  1       40      20       27        35
  </code></pre>
  
  <p>i am looking to normalize the <code>count</code> and <code>value</code> column by dividing the values with the 99th percentile of that column.
  and after the division it the value exceeds 1 make it as 1.</p>
  
  <p>what i am trying is</p>
  
  <pre><code>count_quantile_99 = df['count'].quantile(.99)    #finding 99th percentile of count &amp; storing in variable
      value_quantile_99 = df['count'].quantile(.99)    #finding 99th percentile of value &amp; storing in variable
  
  df['count'] = df.count.div(count_quantile_99 )
  df['value'] = df.value.div(value_quantile_99)
  </code></pre>
  
  <p>I dont know whether this is the right approach.
   also looking for any other better way to find 99th percentile.</p>
  
  <p>Also whenever my value in column <code>count</code> and <code>value</code> Greater than <code>1</code>
  how to make it 1</p>