title: Pandas: counting unique datetime values in group by gives weird values
body: <p>So I got this DataFrame, built in a way so that for column <code>id</code> equal to 2, we have two different values in column <code>num</code> and <code>my_date</code>:</p>
  
  <pre><code>import pandas as pd
  
  a = pd.DataFrame({'id': [1, 2, 3, 2], 
                    'my_date': [datetime(2017, 1, i) for i in range(1, 4)] + [datetime(2017, 1, 1)],
                    'num': [2, 3, 1, 4]
              })
  </code></pre>
  
  <p>For convenience, this is the DataFrame in a readable visual:</p>
  
  <p><a href="https://i.stack.imgur.com/iX66V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iX66V.png" alt="dataframe"></a></p>
  
  <p>If I want to count the number of unique values for each <code>id</code>, I'd do</p>
  
  <pre><code>grouped_a = a.groupby('id').agg({'my_date': pd.Series.nunique, 
                                   'num': pd.Series.nunique}).reset_index()
  grouped_a.columns = ['id', 'num_unique_num', 'num_unique_my_date']
  </code></pre>
  
  <p>which gives this weird (?) result:</p>
  
  <p><a href="https://i.stack.imgur.com/NOv5d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NOv5d.png" alt="grouped_dataframe"></a></p>
  
  <p>Looks like the counting unique values on the <code>datetime</code> (which in Pandas converts to a <code>datetime64[ns]</code>) type is not working?</p>