[Numpy-discussion] timedelta64 NaT doesn't print correctly when printing an ndarray

Tanay Shah tanayamitshah at gmail.com
Wed Oct 30 16:32:31 EDT 2013


When printing a timedelta64('NaT') scalar, it converts to string correctly
but when you print an ndarray where an element is timedelta64('NaT'), it
prints the element as its internal representation (-9223372036854775808)


>>> numpy.timedelta64('NaT')
numpy.timedelta64('NaT')
>>> print numpy.timedelta64('NaT')
NaT

>>> numpy.array([None], dtype=numpy.timedelta64)
array([-9223372036854775808], dtype=timedelta64)
>>> print numpy.array([None], dtype=numpy.timedelta64)
[-9223372036854775808]

Could someone suggest a method by which I can get around this to display the
NaT correctly?



--
View this message in context: http://numpy-discussion.10968.n7.nabble.com/timedelta64-NaT-doesn-t-print-correctly-when-printing-an-ndarray-tp35596.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.



More information about the NumPy-Discussion mailing list