title: How to count and percentage from csv file in pandas
body: <p>i have 3gb csv file and How to count duplicate URLs and percentages</p>
  
  <p>is the sum to calculate the percentage?</p>
  
  <pre><code>import pandas as pd
  df = pd.read_csv("/Users/url_all/auguesturl.csv",names=['URL','Count'])
  dd = df.groupby(
      df.columns.tolist(),
      as_index=False
  ).size().sort_values(ascending=False).apply(lambda r: r/r.sum(),axis=1)
  # percentage
  # ss = df.groupby('Count').size() / df.groupby('Count').size().sum()
  print(dd)
  </code></pre>
  
  <p>my output is:</p>
  
  <pre><code>setup.iclo.com:443  8354271
  da.ds-int.net:443   7278819
  </code></pre>
  
  <p>I like the output like this</p>
  
  <pre><code>URL                          Count      Percentage
  googleads.g.doubl.net:443   1,314,530   2.1 
  s.yimg.com:443              986,275     1.6 
  </code></pre>