[Numpy-discussion] RFC: A (second) proposal for implementing some date/time types in NumPy
Mon Jul 28 13:31:07 CDT 2008
Sorry for the very long delay in commenting on this. In short, it looks
great, and thanks for your efforts.
A couple small comments:
> In : t = datetime.datetime.now() # setter in action
> In : t
> Out: '2008-07-16T13:39:25.315' # representation in ISO 8601
I like that, but what about:
> In : t1 = numpy.zeros(5, dtype="datetime64[s]")
> In : t2 = numpy.ones(5, dtype="datetime64[s]")
> In : t = t2 - t1
> In : t = 24 # setter in action (setting to 24 seconds)
Is there a way to set in any other units? (hours, days, etc.)
> In : t
> Out: 24 # representation as an int64
why not a "pretty" representation of timedelta64 too? I'd like that
better (at least for __str__, perhaps __repr__ should be the raw numbers.
how will operations between different types work?
> t1 = numpy.ones(5, dtype="timedelta64[s]")
> t2 = numpy.ones(5, dtype="timedelta64[ms]")
t1 + t2
Christopher Barker, Ph.D.
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
More information about the Numpy-discussion