[Numpy-discussion] NumPy date/time types and the resolution concept

Pierre GM pgmdevlist@gmail....
Mon Jul 14 08:34:49 CDT 2008


On Monday 14 July 2008 09:07:47 Francesc Alted wrote:
> The advantage of this abstraction is that the user can easily choose the
> scale of resolution that better fits his need.  I'm thinking in
> providing the next resolutions:
>
> ["femtosec", "picosec", "nanosec", "microsec", "millisec", "sec", "min",
> "hour", "month", "year"]

In TimeSeries, we don't have anything less than a second, but we 
have 'daily', 'business daily', 'weekly' and 'quarterly' resolutions. 

A very useful point that Matt Knox had coded is the possibility to specify 
starting points for switching from one resolution to another. For example, 
you can have a series with a 'ANN_MAR' frequency, that corresponds to 1 point 
a year, the year starting in April. When switching back to a monthly 
resolution, the points from January to March of the first year will be 
masked.

Another useful point would be allow the user to define his/her own resolution 
(every 15min, every 12h...). Right now it's a bit clunky in TimeSeries, we 
have to use the lowest resolution of the series (min, hour) and leave a lot 
of blanks (TimeSeries don't have to be regularly spaced, but it helps...)

> Now, it comes the tricky part: how to integrate the notion
> of 'resolution' with the 'dtype' data type factory of NumPy?  

In TimeSeries, the frequency is stored as an integer. For example, a daily 
frequency is stored as 6000, an annual frequency as 1000, a 'ANN_MAR' 
frequency as 1003...


More information about the Numpy-discussion mailing list