[Numpy-discussion] Dates and times and Datetime64 (again)

Alexander Belopolsky ndarray at mac.com
Fri Apr 11 20:24:09 EDT 2014


On Fri, Apr 11, 2014 at 7:58 PM, Stephan Hoyer <shoyer at gmail.com> wrote:

> print datetime(2010, 1, 1) < np.datetime64('2011-01-01') # raises exception


This is somewhat consistent with

>>> from datetime import *
>>> datetime(2010, 1, 1) < date(2010, 1, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't compare datetime.datetime to datetime.date

but I would expect date(2010, 1, 1) < np.datetime64('2011-01-01') to return
False.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140411/b2af8a9a/attachment.html>


More information about the NumPy-Discussion mailing list