[Numpy-discussion] RFC: A proposal for implementing some date/time types in NumPy
Fri Jul 11 13:37:54 CDT 2008
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]
More information about the Numpy-discussion