title: pandas: drop duplicates in groupby 'date'
body: <p>In the dataframe below, I would like to eliminate the duplicate <code>cid</code> values so the output from <code>df.groupby('date').cid.size()</code> matches the output from <code>df.groupby('date').cid.nunique()</code>.</p>
  
  <p>I have looked at this <a href="https://stackoverflow.com/questions/19556165/how-can-i-drop-duplicate-data-in-a-single-column-group-wise-in-pandas">post</a> but it does not seem to have a solid solution to the problem.</p>
  
  <pre><code>df = pd.read_csv('https://raw.githubusercontent.com/108michael/ms_thesis/master/crsp.dime.mpl.df')
  
  df.groupby('date').cid.size()
  
  date
  2005       7
  2006     237
  2007    3610
  2008    1318
  2009    2664
  2010     997
  2011    6390
  2012    2904
  2013    7875
  2014    3979
  
  df.groupby('date').cid.nunique()
  
  date
  2005      3
  2006     10
  2007    227
  2008     52
  2009    142
  2010     57
  2011    219
  2012     99
  2013    238
  2014    146
  Name: cid, dtype: int64
  </code></pre>
  
  <p>Things I tried:</p>
  
  <ol>
  <li><code>df.groupby([df['date']]).drop_duplicates(cols='cid')</code> gives this error: <code>AttributeError: Cannot access callable attribute 'drop_duplicates' of 'DataFrameGroupBy' objects, try using the 'apply' method</code></li>
  <li><code>df.groupby(('date').drop_duplicates('cid'))</code> gives this error: <code>AttributeError: 'str' object has no attribute 'drop_duplicates'</code></li>
  </ol>