title: Datetime and Timestamp equality in Python and Pandas
body: <p>I've been playing around with datetimes and timestamps, and I've come across something that I can't understand.</p>
  
  <pre><code>import pandas as pd
  import datetime
  
  year_month = pd.DataFrame({'year':[2001,2002,2003], 'month':[1,2,3]})
  year_month['date'] = [datetime.datetime.strptime(str(y) + str(m) + '1', '%Y%m%d') for y,m in zip(year_month['year'], year_month['month'])]
  
  &gt;&gt;&gt; year_month
    month  year       date
  0     1  2001 2001-01-01
  1     2  2002 2002-02-01
  2     3  2003 2003-03-01
  </code></pre>
  
  <p>I think the unique function is doing something to the timestamps that is changing them somehow:</p>
  
  <pre><code>first_date = year_month['date'].unique()[0]
  
  &gt;&gt;&gt; first_date == year_month['date'][0]
  False
  </code></pre>
  
  <p>In fact:</p>
  
  <pre><code>&gt;&gt;&gt; year_month['date'].unique()
  array(['2000-12-31T16:00:00.000000000-0800',
         '2002-01-31T16:00:00.000000000-0800',
         '2003-02-28T16:00:00.000000000-0800'], dtype='datetime64[ns]')
  </code></pre>
  
  <p>My suspicions are that there is some sort of timezone difference underneath the functions, but I can't figure it out.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I just checked the python commands list(set()) as an alternative to the unique function, and that works.  This must be a quirk of the unique() function.</p>