[Numpy-discussion] RFC: A proposal for implementing some date/time types in NumPy
Charles R Harris
Fri Jul 11 13:51:15 CDT 2008
On Fri, Jul 11, 2008 at 12:37 PM, Francesc Alted <email@example.com>
> A Friday 11 July 2008, Francesc Alted escrigué:
> > A Friday 11 July 2008, Jon Wright escrigué:
> > > Hello,
> > >
> > > Nice idea - please can you make it work with matplotlib's time/date
> > > stuff too?
> > Hmmm, following the matplotlib docstrings:
> > """
> > datetime objects are converted to floating point numbers
> > which represent the number of days since 0001-01-01 UTC
> > """
> > So it is using something similar to the ``timefloat64`` in our
> > proposal, but with a different scale (it is counting days instead of
> > microseconds) and a different epoch (0001-01-01 UTC instead of
> > 1970-01-01 UTC).
> > So, it seems that setters/getters for matplotlib datetime could be
> > supported, maybe at the risk of loosing precision. We should study
> > this more carefully, but I suppose that if there is interest enough
> > that could be implemented, yes.
> Now that I think about this, wouldn't be better if, after the eventual
> introduction of the new datetime types in NumPy, the matplotlib would
> use any of these three and throw away their current datetime class?
> [Unless they have good reasons for keeping their epoch and/or scale]
Especially as there was a ten day adjustment made with the adoption of the
Gregorian calender on Oct 4, 1582; early dates can be hard to interpret.
Curiously, IIRC, 01/01/0001 was a Monday.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion