title: Cleaning up URL column in pandas dataframe
body: <p>I have the csv (or the dataframe) with the content as follows:</p>
  
  <pre><code>date          | URLs                                         | Count
  -----------------------------------------------------------------------
  17-mar-2014   | www.example.com/abcdef&amp;=randstring           | 20
  10-mar-2016   | www.example.com/xyzabc                       | 12
  14-apr-2015   | www.example.com/abcdef                       | 11
  12-mar-2016   | www.example.com/abcdef/randstring            | 30
  15-mar-2016   | www.example.com/abcdef                       | 10
  17-feb-2016   | www.example.com/xyzabc&amp;=randstring           | 15
  17-mar-2016   | www.example.com/abcdef&amp;=someotherrandstring  | 12
  </code></pre>
  
  <p>I want to clean up the column 'URLs'  where I want to convert <code>www.example.com/abcdef&amp;=randstring</code> or <code>www.example.com/abcdef/randstring</code> to just www.example.com/abcdef, and so on, for all the rows.</p>
  
  <p>I tried to play around with <code>urlparse</code> library and parse the URLs to combile just the <code>urlparse(url).netloc</code> along with <code>urlparse(url).path</code>/<code>query</code>/<code>params</code>. But, it tuned out to be inefficient as every URL leads to completely different path/query/params. </p>
  
  <p>Is there any work around for this using pandas? Any hints/ suggestions are much appreciated.</p>